Files
omarchy-pkgs/pkgbuilds/edge/linux-ptl-audio/0017-ASoC-SDCA-Fix-NULL-pointer-dereference-in-sdca_jack_.patch
T
Gaggery Tsai 35ed17f238 Add linux-ptl-audio kernel package for Panther Lake SDCA audio
Alternative kernel package based on Arch Linux 6.19.9 with 12 upstream
SDCA backport patches that enable audio on Intel Panther Lake systems
(Dell XPS 2026 and similar hardware with CS35L57 SoundWire amps).

The stock 6.19.9 kernel lacks the SDCA class/function topology driver
code needed for PTL audio. These patches backport the SDCA support from
mainline v7.0 to the stable 6.19.x series.

Tested on Dell XPS 16 (Panther Lake): all 4 CS35L57 amps probe with
calibration, SDCA jack detection works, sof-soundwire sound card
registers successfully.

CONFIG_RUST is disabled to avoid build failures with newer Rust
toolchain versions. Rust is not required for audio functionality.
2026-03-19 14:58:29 -07:00

44 lines
1.4 KiB
Diff

From 849489b94fe35172a4fea6e09acabacd273d8993 Mon Sep 17 00:00:00 2001
From: TsaiGaggery <gaggery.tsai@intel.com>
Date: Wed, 11 Mar 2026 14:21:39 -0700
Subject: [PATCH 17/17] ASoC: SDCA: Fix NULL pointer dereference in
sdca_jack_process()
Add NULL guard for card and card->snd_card before dereferencing.
During card teardown, component->card can be NULL when an IRQ fires.
---
sound/soc/sdca/sdca_jack.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/sound/soc/sdca/sdca_jack.c b/sound/soc/sdca/sdca_jack.c
index 605514f02045..04ff391aa7bc 100644
--- a/sound/soc/sdca/sdca_jack.c
+++ b/sound/soc/sdca/sdca_jack.c
@@ -37,13 +37,21 @@ int sdca_jack_process(struct sdca_interrupt *interrupt)
struct device *dev = interrupt->dev;
struct snd_soc_component *component = interrupt->component;
struct snd_soc_card *card = component->card;
- struct rw_semaphore *rwsem = &card->snd_card->controls_rwsem;
+ struct rw_semaphore *rwsem;
struct jack_state *state = interrupt->priv;
- struct snd_kcontrol *kctl = state->kctl;
+ struct snd_kcontrol *kctl;
struct snd_ctl_elem_value *ucontrol __free(kfree) = NULL;
unsigned int reg, val;
int ret;
+ if (!card || !card->snd_card) {
+ dev_dbg(dev, "card not yet bound, deferring jack event\n");
+ return -ENODEV;
+ }
+
+ rwsem = &card->snd_card->controls_rwsem;
+ kctl = state->kctl;
+
guard(rwsem_write)(rwsem);
if (!kctl) {
--
2.43.0