]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.17-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 Apr 2022 11:01:24 +0000 (13:01 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 Apr 2022 11:01:24 +0000 (13:01 +0200)
added patches:
alsa-nm256-don-t-call-card-private_free-at-probe-error-path.patch

queue-5.17/alsa-nm256-don-t-call-card-private_free-at-probe-error-path.patch [new file with mode: 0644]
queue-5.17/series

diff --git a/queue-5.17/alsa-nm256-don-t-call-card-private_free-at-probe-error-path.patch b/queue-5.17/alsa-nm256-don-t-call-card-private_free-at-probe-error-path.patch
new file mode 100644 (file)
index 0000000..00fb65e
--- /dev/null
@@ -0,0 +1,44 @@
+From f20ae5074dfb38f23b0c07c62bdf8e7254a0acf8 Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Tue, 12 Apr 2022 12:26:36 +0200
+Subject: ALSA: nm256: Don't call card private_free at probe error path
+
+From: Takashi Iwai <tiwai@suse.de>
+
+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>
+---
+ sound/pci/nm256/nm256.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/sound/pci/nm256/nm256.c
++++ b/sound/pci/nm256/nm256.c
+@@ -1573,7 +1573,6 @@ snd_nm256_create(struct snd_card *card,
+       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_de
+       err = snd_card_register(card);
+       if (err < 0)
+               return err;
++      card->private_free = snd_nm256_free;
+       pci_set_drvdata(pci, card);
+       return 0;
index 170c51e56c974f3aa460c8e1f54d649ea7588344..8eb21f1b3683d52826f485300ad1213d49a19657 100644 (file)
@@ -54,3 +54,4 @@ alsa-sonicvibes-fix-the-missing-snd_card_free-call-at-probe-error.patch
 alsa-via82xx-fix-the-missing-snd_card_free-call-at-probe-error.patch
 alsa-usb-audio-cap-upper-limits-of-buffer-period-bytes-for-implicit-fb.patch
 alsa-memalloc-add-fallback-sg-buffer-allocations-for-x86.patch
+alsa-nm256-don-t-call-card-private_free-at-probe-error-path.patch