mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-15 08:14:15 +08:00
ALSA: nm256: Don't call card private_free at probe error path
commitf20ae5074d
upstream. The card destructor of nm256 driver does merely stopping the running streams, and it's superfluous for the probe error handling. Moreover, calling this via the previous devres change would lead to another problem due to the reverse call order. This patch moves the setup of the private_free callback after the card registration, so that it can be used only after fully set up. Fixes:c19935f047
("ALSA: nm256: Allocate resources with device-managed APIs") Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20220412102636.16000-40-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
425c83e289
commit
aa4845194b
@ -1573,7 +1573,6 @@ snd_nm256_create(struct snd_card *card, struct pci_dev *pci)
|
||||
chip->coeffs_current = 0;
|
||||
|
||||
snd_nm256_init_chip(chip);
|
||||
card->private_free = snd_nm256_free;
|
||||
|
||||
// pci_set_master(pci); /* needed? */
|
||||
return 0;
|
||||
@ -1680,6 +1679,7 @@ static int snd_nm256_probe(struct pci_dev *pci,
|
||||
err = snd_card_register(card);
|
||||
if (err < 0)
|
||||
return err;
|
||||
card->private_free = snd_nm256_free;
|
||||
|
||||
pci_set_drvdata(pci, card);
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user