Skip to contentSkip to conversation

ALSA: es1688: Add the missed snd_card_free()

PATCH Applied Chuhong Yuan 2 participants 2 messages Jun 3, 2020 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: es1688: Add the missed snd_card_free()

snd_es968_pnp_detect() misses a snd_card_free() in a failed path. Add the missed function call to fix it.

Fixes a20971b201ac ("ALSA: Merge es1688 and es968 drivers")
---
 sound/isa/es1688/es1688.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
sound/isa/es1688/es1688.c +3 -1
index ff3a05ad99c0..64610571a5e1 100644
@@ -267,8 +267,10 @@ static int snd_es968_pnp_detect(struct pnp_card_link *pcard,
 		return error;
 	}
 	error = snd_es1688_probe(card, dev);
-	if (error < 0)
+	if (error < 0) {
+		snd_card_free(card);
 		return error;
+	}
 	pnp_set_card_drvdata(pcard, card);
 	snd_es968_pnp_is_probed = 1;
 	return 0;
Signature · 1 line
2.26.2
Applied
#1 lore raw
Quoted 6 lines · Chuhong Yuan

snd_es968_pnp_detect() misses a snd_card_free() in a failed path. Add the missed function call to fix it.

Fixes a20971b201ac ("ALSA: Merge es1688 and es968 drivers")

Thanks, applied now with Cc-to-stable.

Takashi