All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: wm8994: Fix potential DSP control text array leaks
@ 2026-11-12 13:59 Guangshuo Li
  2026-11-12 14:18 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Guangshuo Li @ 2026-11-12 13:59 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai
  Cc: patches, linux-sound, linux-kernel

wm8958_dsp2_init() allocates text arrays for the DSP mode controls,
but component removal does not free them.

Release the arrays on removal and clear their pointers so a later
component probe that stops partway through allocation cannot leave
old pointers for the next removal.

This issue was found by our static analysis tool under development.

Fixes: 131d81061eba ("ASoC: Allow user-specified WM8958 multiband compressor configurations")
Signed-off-by: Guangshuo Li <liguangshuo@mail.sdu.edu.cn>
---
 sound/soc/codecs/wm8994.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c
index 6b91e02f130b..1c7619f1d481 100644
--- a/sound/soc/codecs/wm8994.c
+++ b/sound/soc/codecs/wm8994.c
@@ -4640,6 +4640,14 @@ static void wm8994_component_remove(struct snd_soc_component *component)
 	release_firmware(wm8994->mbc_vss);
 	release_firmware(wm8994->enh_eq);
 	kfree(wm8994->retune_mobile_texts);
+	kfree(wm8994->mbc_texts);
+	kfree(wm8994->vss_texts);
+	kfree(wm8994->vss_hpf_texts);
+	kfree(wm8994->enh_eq_texts);
+	wm8994->mbc_texts = NULL;
+	wm8994->vss_texts = NULL;
+	wm8994->vss_hpf_texts = NULL;
+	wm8994->enh_eq_texts = NULL;
 }
 
 static const struct snd_soc_component_driver soc_component_dev_wm8994 = {

base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4

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

end of thread, other threads:[~2026-11-12 14:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-12 13:59 [PATCH] ASoC: wm8994: Fix potential DSP control text array leaks Guangshuo Li
2026-11-12 14:18 ` sashiko-bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.