Commit 3c5902d2 authored by Youling Tang's avatar Youling Tang Committed by Tony Lindgren

ARM: OMAP2+: Fix memleak in omap2xxx_clkt_vps_init

If the clk_register fails, we should free hw before function returns to
prevent memleak.
Signed-off-by: default avatarYouling Tang <tangyouling@loongson.cn>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 3650b228
......@@ -244,6 +244,12 @@ void omap2xxx_clkt_vps_init(void)
hw->hw.init = &init;
clk = clk_register(NULL, &hw->hw);
if (IS_ERR(clk)) {
printk(KERN_ERR "Failed to register clock\n");
kfree(hw);
return;
}
clkdev_create(clk, "cpufreq_ck", NULL);
return;
cleanup:
......
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