Commit fc666936 authored by Dmitry Osipenko's avatar Dmitry Osipenko Committed by Stephen Boyd

clk: tegra: Fix double-free in tegra_clk_init()

It's unlikely to happen in practice ever, but makes static checkers happy.

Fixes: 535f296d ("clk: tegra: Add suspend and resume support on Tegra210")
Reported-by: default avatarStephen Boyd <sboyd@kernel.org>
Signed-off-by: default avatarDmitry Osipenko <digetx@gmail.com>
Link: https://lkml.kernel.org/r/20191210020512.6088-1-digetx@gmail.comAcked-by: default avatarThierry Reding <treding@nvidia.com>
Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
parent 67f96ff7
...@@ -231,8 +231,10 @@ struct clk ** __init tegra_clk_init(void __iomem *regs, int num, int banks) ...@@ -231,8 +231,10 @@ struct clk ** __init tegra_clk_init(void __iomem *regs, int num, int banks)
periph_banks = banks; periph_banks = banks;
clks = kcalloc(num, sizeof(struct clk *), GFP_KERNEL); clks = kcalloc(num, sizeof(struct clk *), GFP_KERNEL);
if (!clks) if (!clks) {
kfree(periph_clk_enb_refcnt); kfree(periph_clk_enb_refcnt);
return NULL;
}
clk_num = num; clk_num = num;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment