mirror of https://gitee.com/openkylin/linux.git
ARM: OMAP2+: Fix kfree NULL pointer in omap2xxx_clkt_vps_init
The returns pointer is NULL when kzalloc fails to apply for space, so fix kfree NULL pointer. Signed-off-by: Youling Tang <tangyouling@loongson.cn> Signed-off-by: Tony Lindgren <tony@atomide.com>
This commit is contained in:
parent
3c5902d270
commit
c3f244d577
|
@ -235,7 +235,7 @@ void omap2xxx_clkt_vps_init(void)
|
||||||
|
|
||||||
hw = kzalloc(sizeof(*hw), GFP_KERNEL);
|
hw = kzalloc(sizeof(*hw), GFP_KERNEL);
|
||||||
if (!hw)
|
if (!hw)
|
||||||
goto cleanup;
|
return;
|
||||||
init.name = "virt_prcm_set";
|
init.name = "virt_prcm_set";
|
||||||
init.ops = &virt_prcm_set_ops;
|
init.ops = &virt_prcm_set_ops;
|
||||||
init.parent_names = &parent_name;
|
init.parent_names = &parent_name;
|
||||||
|
@ -251,8 +251,5 @@ void omap2xxx_clkt_vps_init(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
clkdev_create(clk, "cpufreq_ck", NULL);
|
clkdev_create(clk, "cpufreq_ck", NULL);
|
||||||
return;
|
|
||||||
cleanup:
|
|
||||||
kfree(hw);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue