]> git.baikalelectronics.ru Git - kernel.git/commit
clk: Fix pointer casting to prevent oops in devm_clk_release()
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Mon, 20 Jun 2022 17:18:15 +0000 (19:18 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 6 Feb 2023 06:52:48 +0000 (07:52 +0100)
commit51a71cbd03d15f72712bbe11af35d34918c53fdc
tree9b729c0a3b8566559689dc36bbece409a612c423
parent2eaa109b845f01c50cecd558ebcdf1e75647c12b
clk: Fix pointer casting to prevent oops in devm_clk_release()

commit d64a70b3b69c99cb82f93b34a09213247e20653c 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: 111eac8fbc76 ("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