* [PATCH 1/2] ALSA: hda/ca0132: set codec->spec to NULL after freeing
@ 2026-08-12 3:30 songxiebing
2026-08-12 5:35 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: songxiebing @ 2026-08-12 3:30 UTC (permalink / raw)
To: tiwai, perex; +Cc: linux-sound, linux-kernel, songxiebing
From: Bob Song <songxiebing@kylinos.cn>
ca0132_free() and dbpro_free() call kfree(codec->spec) without
setting codec->spec to NULL afterward, leaving a dangling pointer.
Set it to NULL.
Signed-off-by: Bob Song <songxiebing@kylinos.cn>
---
sound/hda/codecs/ca0132.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sound/hda/codecs/ca0132.c b/sound/hda/codecs/ca0132.c
index 3fe11983d6ca..424224ef4621 100644
--- a/sound/hda/codecs/ca0132.c
+++ b/sound/hda/codecs/ca0132.c
@@ -9634,6 +9634,7 @@ static void ca0132_free(struct hda_codec *codec)
#endif
kfree(spec->spec_init_verbs);
kfree(codec->spec);
+ codec->spec = NULL;
}
static void dbpro_free(struct hda_codec *codec)
@@ -9644,6 +9645,7 @@ static void dbpro_free(struct hda_codec *codec)
kfree(spec->spec_init_verbs);
kfree(codec->spec);
+ codec->spec = NULL;
}
static void ca0132_config(struct hda_codec *codec)
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-08-12 5:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-12 3:30 [PATCH 1/2] ALSA: hda/ca0132: set codec->spec to NULL after freeing songxiebing
2026-08-12 5:35 ` Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).