Commit 3e00eee1 authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by sanglipeng
Browse files

clk: Fix pointer casting to prevent oops in devm_clk_release()

stable inclusion
from stable-v5.10.166
commit 19f1f99be3716cc08071e25ba159813318ab0d9e
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7TH9O

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=19f1f99be3716cc08071e25ba159813318ab0d9e



--------------------------------

commit 8b3d743f 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: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
Fixes: abae8e57 ("clk: generalize devm_clk_get() a bit")
Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20220620171815.114212-1-u.kleine-koenig@pengutronix.de


Tested-by: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
Tested-by: default avatarLinux Kernel Functional Testing <lkft@linaro.org>
Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent ff6a3586
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment