Commit 65ea7d69 authored by Chuhong Yuan's avatar Chuhong Yuan Committed by Khalid Elmously

ALSA: es1688: Add the missed snd_card_free()

BugLink: https://bugs.launchpad.net/bugs/1884564

commit d9b8fbf1 upstream.

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

Fixes: a20971b2 ("ALSA: Merge es1688 and es968 drivers")
Signed-off-by: default avatarChuhong Yuan <hslester96@gmail.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20200603092459.1424093-1-hslester96@gmail.comSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
parent d1b4430f
...@@ -284,8 +284,10 @@ static int snd_es968_pnp_detect(struct pnp_card_link *pcard, ...@@ -284,8 +284,10 @@ static int snd_es968_pnp_detect(struct pnp_card_link *pcard,
return error; return error;
} }
error = snd_es1688_probe(card, dev); error = snd_es1688_probe(card, dev);
if (error < 0) if (error < 0) {
snd_card_free(card);
return error; return error;
}
pnp_set_card_drvdata(pcard, card); pnp_set_card_drvdata(pcard, card);
snd_es968_pnp_is_probed = 1; snd_es968_pnp_is_probed = 1;
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment