]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 30 Jan 2023 13:12:58 +0000 (14:12 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 30 Jan 2023 13:12:58 +0000 (14:12 +0100)
added patches:
clk-fix-pointer-casting-to-prevent-oops-in-devm_clk_release.patch

queue-5.4/clk-fix-pointer-casting-to-prevent-oops-in-devm_clk_release.patch [new file with mode: 0644]
queue-5.4/series

diff --git a/queue-5.4/clk-fix-pointer-casting-to-prevent-oops-in-devm_clk_release.patch b/queue-5.4/clk-fix-pointer-casting-to-prevent-oops-in-devm_clk_release.patch
new file mode 100644 (file)
index 0000000..744ee3e
--- /dev/null
@@ -0,0 +1,39 @@
+From 8b3d743fc9e2542822826890b482afabf0e7522a Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>
+Date: Mon, 20 Jun 2022 19:18:15 +0200
+Subject: clk: Fix pointer casting to prevent oops in devm_clk_release()
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
+
+commit 8b3d743fc9e2542822826890b482afabf0e7522a upstream.
+
+The release function is called with a pointer to the memory returned by
+devres_alloc(). I was confused about that by the code before the
+generalization that used a struct clk **ptr.
+
+Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
+Fixes: abae8e57e49a ("clk: generalize devm_clk_get() a bit")
+Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
+Link: https://lore.kernel.org/r/20220620171815.114212-1-u.kleine-koenig@pengutronix.de
+Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
+Tested-by: Linux Kernel Functional Testing <lkft@linaro.org>
+Signed-off-by: Stephen Boyd <sboyd@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/clk/clk-devres.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/clk/clk-devres.c
++++ b/drivers/clk/clk-devres.c
+@@ -11,7 +11,7 @@ struct devm_clk_state {
+ static void devm_clk_release(struct device *dev, void *res)
+ {
+-      struct devm_clk_state *state = *(struct devm_clk_state **)res;
++      struct devm_clk_state *state = res;
+       if (state->exit)
+               state->exit(state->clk);
index be277bcfde3a2c010acf386e4427d53d2c1611d2..64db996b17775fe63b11d06af40eb9ae51b0a041 100644 (file)
@@ -106,3 +106,4 @@ block-fix-and-cleanup-bio_check_ro.patch
 x86-i8259-mark-legacy-pic-interrupts-with-irq_level.patch
 netfilter-conntrack-unify-established-states-for-sctp-paths.patch
 perf-x86-amd-fix-potential-integer-overflow-on-shift-of-a-int.patch
+clk-fix-pointer-casting-to-prevent-oops-in-devm_clk_release.patch