Linux Sound subsystem development
 help / color / mirror / Atom feed
* [PATCH v2 0/4] ASoC: codecs: handle component match allocation failures
@ 2026-12-04 12:58 Zhiqi Zhang
  2026-12-04 12:58 ` [PATCH v2 1/4] ASoC: codecs: pm4125: check component match allocation Zhiqi Zhang
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Zhiqi Zhang @ 2026-12-04 12:58 UTC (permalink / raw)
  To: Mark Brown
  Cc: Srinivas Kandagatla, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
	linux-sound, linux-arm-msm, Zhiqi Zhang

Hi,

I found the same low-memory error handling bug in four Qualcomm codec
drivers. component_match_add_release() reports allocation failures by
storing an ERR_PTR in the caller supplied match pointer, but these
drivers did not check that state before passing the pointer to
component_master_add_with_match().

The failed add also does not take ownership of the current OF node
reference, so each patch drops the rx or tx node reference that was not
transferred to a match entry before returning the allocation error.

The wcd938x driver also selects its optional us/euro mux before adding
the SoundWire component matches, so that patch releases the selected mux
state on the new probe-failure exits.

I kept the fixes per driver so each patch has a small, local ownership
change. The wcd938x patch additionally shares the existing mux deselect
path for probe failure and remove cleanup.

I checked the series with scripts/checkpatch.pl --strict.

Changes in v2:
- Release the optional wcd938x us/euro mux on probe failure after it has
  been selected.
- Reuse a shared wcd938x mux deselect helper and clear mux_setup_done
  after deselect.

AI assistance disclosure: I found the bugs. Codex modified the code.
I reviewed the changes.

Zhiqi Zhang (4):
  ASoC: codecs: pm4125: check component match allocation
  ASoC: codecs: wcd937x: check component match allocation
  ASoC: codecs: wcd938x: check component match allocation
  ASoC: codecs: wcd939x: check component match allocation

 sound/soc/codecs/pm4125.c  | 13 +++++++++++++
 sound/soc/codecs/wcd937x.c | 13 +++++++++++++
 sound/soc/codecs/wcd938x.c | 35 +++++++++++++++++++++++++++++------
 sound/soc/codecs/wcd939x.c | 13 +++++++++++++
 4 files changed, 68 insertions(+), 6 deletions(-)

-- 
2.54.0 (Apple Git-157)


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-12-04 13:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-04 12:58 [PATCH v2 0/4] ASoC: codecs: handle component match allocation failures Zhiqi Zhang
2026-12-04 12:58 ` [PATCH v2 1/4] ASoC: codecs: pm4125: check component match allocation Zhiqi Zhang
2026-12-04 13:21   ` sashiko-bot
2026-12-04 12:58 ` [PATCH v2 2/4] ASoC: codecs: wcd937x: " Zhiqi Zhang
2026-12-04 12:58 ` [PATCH v2 3/4] ASoC: codecs: wcd938x: " Zhiqi Zhang
2026-12-04 13:30   ` sashiko-bot
2026-12-04 12:58 ` [PATCH v2 4/4] ASoC: codecs: wcd939x: " Zhiqi Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox