[PATCH 1/2] ALSA: hda/ca0132: set codec->spec to NULL after freeing

From: songxiebing

Date: Tue Aug 11 2026 - 23:33:05 EST


From: Bob Song <songxiebing@xxxxxxxxxx>

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@xxxxxxxxxx>
---
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