[PATCH v2 4/7] ALSA: info: Fix memory leak at card removal
From: Takashi Iwai
Date: Wed Oct 07 2026 - 07:15:23 EST
The fix for potential deadlock at disconnection by the commit
c7a606519533 ("ALSA: info: Fix potential deadlock at disconnection")
clears card->proc_root pointer at snd_info_card_disconnect(), in order
just to be sure. But this leads to a memory leak of card->proc_root
content that should have been released at a later call of
snd_info_card_free().
For addressing the memory leak, simply drop the card->proc_root
clearance at snd_info_card_disconnect().
Fixes: c7a606519533 ("ALSA: info: Fix potential deadlock at disconnection")
Reported-by: Sashiko <sashiko-bot@xxxxxxxxxx>
Closes: https://sashiko.dev/#/patchset/20261006174002.703431-1-tiwai%40suse.de
Signed-off-by: Takashi Iwai <tiwai@xxxxxxx>
---
sound/core/info.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/sound/core/info.c b/sound/core/info.c
index 3b8ccda04e1a..437dd797e270 100644
--- a/sound/core/info.c
+++ b/sound/core/info.c
@@ -555,7 +555,6 @@ void snd_info_card_disconnect(struct snd_card *card)
if (card->proc_root)
snd_info_clear_entries(card->proc_root);
card->proc_root_link = NULL;
- card->proc_root = NULL;
}
/*
--
2.55.0