On Wed, 7 Apr 2021 at 02:06, Dmitry Baryshkov dmitry.baryshkov@linaro.org wrote:
devm_clk_hw_register_fixed_factor_release(), the release function for the devm_clk_hw_register_fixed_factor(), calls clk_hw_unregister_fixed_factor(), which will kfree() the clock. However after that the devres functions will also kfree the allocated data, resulting in double free/memory corruption. Just call clk_hw_unregister() instead, leaving kfree() to devres code.
Reported-by: Rob Clark robdclark@chromium.org Cc: Daniel Palmer daniel@0x0f.com
Forgot:
Fixes: 0b9266d295ce ("clk: fixed: add devm helper for clk_hw_register_fixed_factor()")
Signed-off-by: Dmitry Baryshkov dmitry.baryshkov@linaro.org
Stephen, this fix affects the DSI PHY rework. Do we have a chance of getting it into 5.12, otherwise there will be a cross-dependency between msm-next and clk-next.
drivers/clk/clk-fixed-factor.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)