Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <sboyd@kernel.org>
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Link: https://lkml.kernel.org/r/20191210020512.6088-1-digetx@gmail.com
Acked-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>

authored by

Dmitry Osipenko and committed by
Stephen Boyd
fc666936 67f96ff7

+3 -1
+3 -1
drivers/clk/tegra/clk.c
··· 231 231 periph_banks = banks; 232 232 233 233 clks = kcalloc(num, sizeof(struct clk *), GFP_KERNEL); 234 - if (!clks) 234 + if (!clks) { 235 235 kfree(periph_clk_enb_refcnt); 236 + return NULL; 237 + } 236 238 237 239 clk_num = num; 238 240