]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.15-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Apr 2025 10:52:18 +0000 (12:52 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Apr 2025 10:52:18 +0000 (12:52 +0200)
added patches:
mmc-sdhci-brcmstb-initialize-base_clk-to-null-in-sdhci_brcmstb_probe.patch

queue-5.15/mmc-sdhci-brcmstb-initialize-base_clk-to-null-in-sdhci_brcmstb_probe.patch [new file with mode: 0644]
queue-5.15/series

diff --git a/queue-5.15/mmc-sdhci-brcmstb-initialize-base_clk-to-null-in-sdhci_brcmstb_probe.patch b/queue-5.15/mmc-sdhci-brcmstb-initialize-base_clk-to-null-in-sdhci_brcmstb_probe.patch
new file mode 100644 (file)
index 0000000..1db2917
--- /dev/null
@@ -0,0 +1,45 @@
+From c3c0ed75ffbff5c70667030b5139bbb75b0a30f5 Mon Sep 17 00:00:00 2001
+From: Nathan Chancellor <nathan@kernel.org>
+Date: Wed, 8 Jun 2022 08:27:57 -0700
+Subject: mmc: sdhci-brcmstb: Initialize base_clk to NULL in sdhci_brcmstb_probe()
+
+From: Nathan Chancellor <nathan@kernel.org>
+
+commit c3c0ed75ffbff5c70667030b5139bbb75b0a30f5 upstream.
+
+Clang warns a few times along the lines of:
+
+  drivers/mmc/host/sdhci-brcmstb.c:302:6: warning: variable 'base_clk' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
+          if (res)
+              ^~~
+  drivers/mmc/host/sdhci-brcmstb.c:376:24: note: uninitialized use occurs here
+          clk_disable_unprepare(base_clk);
+                                ^~~~~~~~
+
+base_clk is used in the error path before it is initialized. Initialize
+it to NULL, as clk_disable_unprepare() calls clk_disable() and
+clk_unprepare(), which both handle NULL pointers gracefully.
+
+Link: https://github.com/ClangBuiltLinux/linux/issues/1650
+Reported-by: kernel test robot <lkp@intel.com>
+Signed-off-by: Nathan Chancellor <nathan@kernel.org>
+Acked-by: Florian Fainelli <f.fainelli@gmail.com>
+Acked-by: Adrian Hunter <adrian.hunter@intel.com>
+Link: https://lore.kernel.org/r/20220608152757.82529-1-nathan@kernel.org
+Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/mmc/host/sdhci-brcmstb.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/mmc/host/sdhci-brcmstb.c
++++ b/drivers/mmc/host/sdhci-brcmstb.c
+@@ -257,7 +257,7 @@ static int sdhci_brcmstb_probe(struct pl
+       struct sdhci_host *host;
+       struct resource *iomem;
+       struct clk *clk;
+-      struct clk *base_clk;
++      struct clk *base_clk = NULL;
+       int res;
+       match = of_match_node(sdhci_brcm_of_match, pdev->dev.of_node);
index 9cb2ccc3f2d16b43781cafbb819c16d5b3618b2f..10903a42730005bc8282a741d2e97ca31917996c 100644 (file)
@@ -278,3 +278,4 @@ nfsd-skip-sending-cb_recall_any-when-the-backchannel-isn-t-up.patch
 mmc-sdhci-brcmstb-use-clk_get_rate-base_clk-in-pm-resume.patch
 mm-slab-remove-duplicate-kernel-doc-comment-for-ksize.patch
 tracing-do-not-use-perf-enums-when-perf-is-not-defined.patch
+mmc-sdhci-brcmstb-initialize-base_clk-to-null-in-sdhci_brcmstb_probe.patch