Patch "clk: rockchip: Fix memory leak in rockchip_clk_register_pll()" has been added to the 4.19-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    clk: rockchip: Fix memory leak in rockchip_clk_register_pll()

to the 4.19-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-rockchip-fix-memory-leak-in-rockchip_clk_registe.patch
and it can be found in the queue-4.19 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 5aa437ef8d712ce864543d735f57a2e9ce50bf75
Author: Xiu Jianfeng <xiujianfeng@xxxxxxxxxx>
Date:   Wed Nov 23 17:12:01 2022 +0800

    clk: rockchip: Fix memory leak in rockchip_clk_register_pll()
    
    [ Upstream commit 739a6a6bbdb793bd57938cb24aa5a6df89983546 ]
    
    If clk_register() fails, @pll->rate_table may have allocated memory by
    kmemdup(), so it needs to be freed, otherwise will cause memory leak
    issue, this patch fixes it.
    
    Fixes: 90c590254051 ("clk: rockchip: add clock type for pll clocks and pll used on rk3066")
    Signed-off-by: Xiu Jianfeng <xiujianfeng@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20221123091201.199819-1-xiujianfeng@xxxxxxxxxx
    Signed-off-by: Heiko Stuebner <heiko@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/clk/rockchip/clk-pll.c b/drivers/clk/rockchip/clk-pll.c
index dd0433d4753e..77aff5defac6 100644
--- a/drivers/clk/rockchip/clk-pll.c
+++ b/drivers/clk/rockchip/clk-pll.c
@@ -972,6 +972,7 @@ struct clk *rockchip_clk_register_pll(struct rockchip_clk_provider *ctx,
 	return mux_clk;
 
 err_pll:
+	kfree(pll->rate_table);
 	clk_unregister(mux_clk);
 	mux_clk = pll_clk;
 err_mux:



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux