]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.6-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 7 Sep 2025 19:53:18 +0000 (21:53 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 7 Sep 2025 19:53:18 +0000 (21:53 +0200)
added patches:
spi-fsl-qspi-fix-double-cleanup-in-probe-error-path.patch

queue-6.6/series
queue-6.6/spi-fsl-qspi-fix-double-cleanup-in-probe-error-path.patch [new file with mode: 0644]

index 192b436ce632d68bdad9c2aac66a31f54ae717c3..f711c1be968ecdefb6819fa61290ee290a8ba17a 100644 (file)
@@ -118,3 +118,4 @@ cpufreq-intel_pstate-rearrange-show_no_turbo-and-sto.patch
 cpufreq-intel_pstate-read-global.no_turbo-under-read.patch
 cpufreq-intel_pstate-check-turbo_is_disabled-in-stor.patch
 dmaengine-mediatek-fix-a-flag-reuse-error-in-mtk_cqd.patch
+spi-fsl-qspi-fix-double-cleanup-in-probe-error-path.patch
diff --git a/queue-6.6/spi-fsl-qspi-fix-double-cleanup-in-probe-error-path.patch b/queue-6.6/spi-fsl-qspi-fix-double-cleanup-in-probe-error-path.patch
new file mode 100644 (file)
index 0000000..9117644
--- /dev/null
@@ -0,0 +1,56 @@
+From 5d07ab2a7fa1305e429d9221716582f290b58078 Mon Sep 17 00:00:00 2001
+From: Kevin Hao <haokexin@gmail.com>
+Date: Thu, 10 Apr 2025 14:56:09 +0800
+Subject: spi: fsl-qspi: Fix double cleanup in probe error path
+
+From: Kevin Hao <haokexin@gmail.com>
+
+commit 5d07ab2a7fa1305e429d9221716582f290b58078 upstream.
+
+Commit 40369bfe717e ("spi: fsl-qspi: use devm function instead of driver
+remove") introduced managed cleanup via fsl_qspi_cleanup(), but
+incorrectly retain manual cleanup in two scenarios:
+
+- On devm_add_action_or_reset() failure, the function automatically call
+  fsl_qspi_cleanup(). However, the current code still jumps to
+  err_destroy_mutex, repeating cleanup.
+
+- After the fsl_qspi_cleanup() action is added successfully, there is no
+  need to manually perform the cleanup in the subsequent error path.
+  However, the current code still jumps to err_destroy_mutex on spi
+  controller failure, repeating cleanup.
+
+Skip redundant manual cleanup calls to fix these issues.
+
+Cc: stable@vger.kernel.org
+Fixes: 40369bfe717e ("spi: fsl-qspi: use devm function instead of driver remove")
+Signed-off-by: Kevin Hao <haokexin@gmail.com>
+Link: https://patch.msgid.link/20250410-spi-v1-1-56e867cc19cf@gmail.com
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/spi/spi-fsl-qspi.c |    7 ++-----
+ 1 file changed, 2 insertions(+), 5 deletions(-)
+
+--- a/drivers/spi/spi-fsl-qspi.c
++++ b/drivers/spi/spi-fsl-qspi.c
+@@ -943,17 +943,14 @@ static int fsl_qspi_probe(struct platfor
+       ret = devm_add_action_or_reset(dev, fsl_qspi_cleanup, q);
+       if (ret)
+-              goto err_destroy_mutex;
++              goto err_put_ctrl;
+       ret = devm_spi_register_controller(dev, ctlr);
+       if (ret)
+-              goto err_destroy_mutex;
++              goto err_put_ctrl;
+       return 0;
+-err_destroy_mutex:
+-      mutex_destroy(&q->lock);
+-
+ err_disable_clk:
+       fsl_qspi_clk_disable_unprep(q);