]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 5.15
authorSasha Levin <sashal@kernel.org>
Fri, 9 Dec 2022 01:01:41 +0000 (20:01 -0500)
committerSasha Levin <sashal@kernel.org>
Fri, 9 Dec 2022 01:01:41 +0000 (20:01 -0500)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-5.15/clk-fix-pointer-casting-to-prevent-oops-in-devm_clk_.patch [new file with mode: 0644]
queue-5.15/series

diff --git a/queue-5.15/clk-fix-pointer-casting-to-prevent-oops-in-devm_clk_.patch b/queue-5.15/clk-fix-pointer-casting-to-prevent-oops-in-devm_clk_.patch
new file mode 100644 (file)
index 0000000..e80e966
--- /dev/null
@@ -0,0 +1,44 @@
+From dedd4c73a5ef43ee1019e5e734fdd794c338f15d Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+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>
+
+[ Upstream commit 8b3d743fc9e2542822826890b482afabf0e7522a ]
+
+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: Sasha Levin <sashal@kernel.org>
+---
+ drivers/clk/clk-devres.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/clk/clk-devres.c b/drivers/clk/clk-devres.c
+index 43ccd20e0298..4fb4fd4b06bd 100644
+--- 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);
+-- 
+2.35.1
+
index 0cde57459d8ba7900d168acd92a02521a6bae989..ea6ae3898f77ac1833defdcde626c0d0d42cc041 100644 (file)
@@ -38,3 +38,4 @@ xen-netback-do-some-code-cleanup.patch
 xen-netback-don-t-call-kfree_skb-with-interrupts-dis.patch
 media-videobuf2-core-take-mmap_lock-in-vb2_get_unmap.patch
 soundwire-intel-initialize-clock-stop-timeout.patch
+clk-fix-pointer-casting-to-prevent-oops-in-devm_clk_.patch