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: Youling Tang <tangyouling@loongson.cn> Signed-off-by: Tony Lindgren <tony@atomide.com>
This commit is contained in:
parent
3650b228f8
commit
3c5902d270
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue