This is a note to let you know that I've just added the patch titled clk: Fix pointer casting to prevent oops in devm_clk_release() to the 5.15-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: clk-fix-pointer-casting-to-prevent-oops-in-devm_clk_.patch and it can be found in the queue-5.15 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit dedd4c73a5ef43ee1019e5e734fdd794c338f15d Author: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx> Date: Mon Jun 20 19:18:15 2022 +0200 clk: Fix pointer casting to prevent oops in devm_clk_release() [ 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@xxxxxxxxxxx> Fixes: abae8e57e49a ("clk: generalize devm_clk_get() a bit") Signed-off-by: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx> Link: https://lore.kernel.org/r/20220620171815.114212-1-u.kleine-koenig@xxxxxxxxxxxxxx Tested-by: Marek Szyprowski <m.szyprowski@xxxxxxxxxxx> Tested-by: Linux Kernel Functional Testing <lkft@xxxxxxxxxx> Signed-off-by: Stephen Boyd <sboyd@xxxxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> 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);