From a29a4043960189b059166c1ace8d44b47ddfef72 Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Thu, 8 Dec 2022 20:01:41 -0500 Subject: [PATCH] Fixes for 5.15 Signed-off-by: Sasha Levin --- ...casting-to-prevent-oops-in-devm_clk_.patch | 44 +++++++++++++++++++ queue-5.15/series | 1 + 2 files changed, 45 insertions(+) create mode 100644 queue-5.15/clk-fix-pointer-casting-to-prevent-oops-in-devm_clk_.patch 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 index 00000000000..e80e9668493 --- /dev/null +++ b/queue-5.15/clk-fix-pointer-casting-to-prevent-oops-in-devm_clk_.patch @@ -0,0 +1,44 @@ +From dedd4c73a5ef43ee1019e5e734fdd794c338f15d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +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 + +[ 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 +Fixes: abae8e57e49a ("clk: generalize devm_clk_get() a bit") +Signed-off-by: Uwe Kleine-König +Link: https://lore.kernel.org/r/20220620171815.114212-1-u.kleine-koenig@pengutronix.de +Tested-by: Marek Szyprowski +Tested-by: Linux Kernel Functional Testing +Signed-off-by: Stephen Boyd +Signed-off-by: Sasha Levin +--- + 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 + diff --git a/queue-5.15/series b/queue-5.15/series index 0cde57459d8..ea6ae3898f7 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -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 -- 2.47.3