diff options
author | Takashi Iwai <tiwai@suse.de> | 2022-04-12 13:26:36 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-04-20 10:34:09 +0300 |
commit | aa4845194b9dd5fa19b34997619a31cbf9a223fb (patch) | |
tree | 2861fec1c73f090d9c8db2ba04d0cc5bf5d95e45 /sound/pci | |
parent | 425c83e2898d1304206bd8a580dfc2e6c3e95334 (diff) | |
download | linux-aa4845194b9dd5fa19b34997619a31cbf9a223fb.tar.xz |
ALSA: nm256: Don't call card private_free at probe error path
commit f20ae5074dfb38f23b0c07c62bdf8e7254a0acf8 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: c19935f04784 ("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>
Diffstat (limited to 'sound/pci')
-rw-r--r-- | sound/pci/nm256/nm256.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/pci/nm256/nm256.c b/sound/pci/nm256/nm256.c index c9c178504959..f99a1e96e923 100644 --- a/sound/pci/nm256/nm256.c +++ b/sound/pci/nm256/nm256.c @@ -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; |