Skip to content

Commit f20ae50

Browse files
committed
ALSA: nm256: Don't call card private_free at probe error path
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: c19935f ("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>
1 parent 4fb2719 commit f20ae50

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

sound/pci/nm256/nm256.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1573,7 +1573,6 @@ snd_nm256_create(struct snd_card *card, struct pci_dev *pci)
15731573
chip->coeffs_current = 0;
15741574

15751575
snd_nm256_init_chip(chip);
1576-
card->private_free = snd_nm256_free;
15771576

15781577
// pci_set_master(pci); /* needed? */
15791578
return 0;
@@ -1680,6 +1679,7 @@ static int snd_nm256_probe(struct pci_dev *pci,
16801679
err = snd_card_register(card);
16811680
if (err < 0)
16821681
return err;
1682+
card->private_free = snd_nm256_free;
16831683

16841684
pci_set_drvdata(pci, card);
16851685
return 0;

0 commit comments

Comments
 (0)