From: Chunyan Zhang <chunyan.zhang@unisoc.com>
Date: Thu, 5 Sep 2019 18:30:09 +0800
Subject: clk: sprd: add missing kfree
Git-commit: 5e75ea9c67433a065b0e8595ad3c91c7c0ca0d2d
Patch-mainline: 5.4-rc1
References: bnc#1151927 5.3.5
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>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/clk/sprd/pll.c | 2 ++
1 file changed, 2 insertions(+)
--- a/drivers/clk/sprd/pll.c
+++ b/drivers/clk/sprd/pll.c
@@ -136,6 +136,7 @@ static unsigned long _sprd_pll_recalc_ra
k2 + refin * nint * CLK_PLL_1M;
}
+ kfree(cfg);
return rate;
}
@@ -222,6 +223,7 @@ static int _sprd_pll_set_rate(const stru
if (!ret)
udelay(pll->udelay);
+ kfree(cfg);
return ret;
}