linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ALSA: es1688: Add the missed snd_card_free()
@ 2020-06-03  9:24 Chuhong Yuan
  2020-06-03  9:41 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Chuhong Yuan @ 2020-06-03  9:24 UTC (permalink / raw)
  Cc: Jaroslav Kysela, Takashi Iwai, Krzysztof Helt, alsa-devel,
	linux-kernel, 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")
Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
---
 sound/isa/es1688/es1688.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sound/isa/es1688/es1688.c b/sound/isa/es1688/es1688.c
index ff3a05ad99c0..64610571a5e1 100644
--- a/sound/isa/es1688/es1688.c
+++ b/sound/isa/es1688/es1688.c
@@ -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;
-- 
2.26.2


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

* Re: [PATCH] ALSA: es1688: Add the missed snd_card_free()
  2020-06-03  9:24 [PATCH] ALSA: es1688: Add the missed snd_card_free() Chuhong Yuan
@ 2020-06-03  9:41 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2020-06-03  9:41 UTC (permalink / raw)
  To: Chuhong Yuan
  Cc: Jaroslav Kysela, Takashi Iwai, Krzysztof Helt, alsa-devel, linux-kernel

On Wed, 03 Jun 2020 11:24:59 +0200,
Chuhong Yuan wrote:
> 
> 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")
> Signed-off-by: Chuhong Yuan <hslester96@gmail.com>

Thanks, applied now with Cc-to-stable.


Takashi

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

end of thread, other threads:[~2020-06-03  9:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-03  9:24 [PATCH] ALSA: es1688: Add the missed snd_card_free() Chuhong Yuan
2020-06-03  9:41 ` 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).