]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
clk: sprd: add missing kfree
authorChunyan Zhang <chunyan.zhang@unisoc.com>
Thu, 5 Sep 2019 10:30:09 +0000 (18:30 +0800)
committerStephen Boyd <sboyd@kernel.org>
Wed, 18 Sep 2019 05:01:02 +0000 (22:01 -0700)
The number of config registers for different pll clocks probably are not
same, so we have to use malloc, and should free the memory before return.

Fixes: 3e37b005580b ("clk: sprd: add adjustable pll support")
Signed-off-by: Chunyan Zhang <chunyan.zhang@unisoc.com>
Signed-off-by: Chunyan Zhang <zhang.lyra@gmail.com>
Link: https://lkml.kernel.org/r/20190905103009.27166-1-zhang.lyra@gmail.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/sprd/pll.c

index 36b4402bf09e363618ff3453e43ba6a02158cc73..640270f51aa56ce413c5528a9854ad4919005f86 100644 (file)
@@ -136,6 +136,7 @@ static unsigned long _sprd_pll_recalc_rate(const struct sprd_pll *pll,
                                         k2 + refin * nint * CLK_PLL_1M;
        }
 
+       kfree(cfg);
        return rate;
 }
 
@@ -222,6 +223,7 @@ static int _sprd_pll_set_rate(const struct sprd_pll *pll,
        if (!ret)
                udelay(pll->udelay);
 
+       kfree(cfg);
        return ret;
 }