WSL2-Linux-Kernel/sound/pci/echoaudio
Takashi Iwai 2a2a75ebdb ALSA: echoaudio: Fix the missing snd_card_free() call at probe error
commit 313c7e5703 upstream.

The previous cleanup with devres may lead to the incorrect release
orders at the probe error handling due to the devres's nature.  Until
we register the card, snd_card_free() has to be called at first for
releasing the stuff properly when the driver tries to manage and
release the stuff via card->private_free().

This patch fixes it by calling snd_card_free() on the error from the
probe callback using a new helper function.

Fixes: 9c211bf392 ("ALSA: echoaudio: Allocate resources with device-managed APIs")
Reported-and-tested-by: Zheyu Ma <zheyuma97@gmail.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/CAMhUBjm2AdyEZ_-EgexdNDN7SvY4f89=4=FwAL+c0Mg0O+X50A@mail.gmail.com
Link: https://lore.kernel.org/r/20220412093141.8008-3-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-20 09:34:06 +02:00
..
Makefile
darla20.c
darla20_dsp.c
darla24.c
darla24_dsp.c
echo3g.c
echo3g_dsp.c
echoaudio.c ALSA: echoaudio: Fix the missing snd_card_free() call at probe error 2022-04-20 09:34:06 +02:00
echoaudio.h
echoaudio_3g.c
echoaudio_dsp.c
echoaudio_dsp.h
echoaudio_gml.c
gina20.c
gina20_dsp.c
gina24.c
gina24_dsp.c
indigo.c
indigo_dsp.c
indigo_express_dsp.c
indigodj.c
indigodj_dsp.c
indigodjx.c
indigodjx_dsp.c
indigoio.c
indigoio_dsp.c
indigoiox.c
indigoiox_dsp.c
layla20.c
layla20_dsp.c
layla24.c
layla24_dsp.c
mia.c
mia_dsp.c
midi.c
mona.c
mona_dsp.c