]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: cs46xx: Fix missing snd_card_free() call at probe error
authorTakashi Iwai <tiwai@suse.de>
Tue, 5 Jul 2022 15:23:36 +0000 (17:23 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Jul 2022 14:34:48 +0000 (16:34 +0200)
commitff02e0debd740c33b78c0175c8cf0663166b6a6f
tree8576452abd65ab03ba769fe64e04727ac8165f62
parent70e5a742ec0ea7a3a206b6495415b07f2a5536cd
ALSA: cs46xx: Fix missing snd_card_free() call at probe error

commit 16bd22df12eba5bea30648f0a0f6c0be19f660be 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() manually on the error
from the probe callback.

Fixes: 2eacf4eb6962 ("ALSA: cs46xx: Allocate resources with device-managed APIs")
Cc: <stable@vger.kernel.org>
Reported-and-tested-by: Jan Engelhardt <jengelh@inai.de>
Link: https://lore.kernel.org/r/p2p1s96o-746-74p4-s95-61qo1p7782pn@vanv.qr
Link: https://lore.kernel.org/r/20220705152336.350-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/pci/cs46xx/cs46xx.c