clk: tegra: Fix double-free in tegra_clk_init()
Subsystems (3)
PATCH 1/1 clk: tegra: Fix double-free in tegra_clk_init()
It's unlikely to happen in practice ever, but makes static checkers happy.
Fixes 535f296d47de ("clk: tegra: Add suspend and resume support on Tegra210")
Reported-by Stephen Boyd <[email protected]>
Signed-off-by Dmitry Osipenko <[email protected]>
--- drivers/clk/tegra/clk.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/clk/tegra/clk.c +3 -1
@@ -231,8 +231,10 @@ struct clk ** __init tegra_clk_init(void __iomem *regs, int num, int banks) periph_banks = banks; clks =kcalloc (num,sizeof (struct clk *),GFP_KERNEL ); -if (!clks) +if (!clks) {kfree (periph_clk_enb_refcnt); +return NULL ; + } clk_num = num;
Signature · 1 line
2.24.0
Quoted 8 lines · Dmitry Osipenko
It's unlikely to happen in practice ever, but makes static checkers happy.
Fixes 535f296d47de ("clk: tegra: Add suspend and resume support on Tegra210")Reported-by Stephen Boyd <[email protected]>Signed-off-by Dmitry Osipenko <[email protected]>--- drivers/clk/tegra/clk.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Good catch:
Acked-by Thierry Reding <[email protected]>
Quoting Dmitry Osipenko (2019-12-09 18:05:12)
Quoted 6 lines
It's unlikely to happen in practice ever, but makes static checkers happy.
Fixes 535f296d47de ("clk: tegra: Add suspend and resume support on Tegra210")Reported-by Stephen Boyd <[email protected]>Signed-off-by Dmitry Osipenko <[email protected]>---
Applied to clk-fixes