summaryrefslogtreecommitdiff
path: root/arch/arm/mach-omap2
diff options
context:
space:
mode:
authorYouling Tang <tangyouling@loongson.cn>2020-11-14 07:07:20 +0300
committerTony Lindgren <tony@atomide.com>2020-11-19 12:44:46 +0300
commitc3f244d5776ecd236657fc1c4b7c5d1d4d01ca7e (patch)
tree158a4ca91d32ee2ce5de82cd149936427476ead9 /arch/arm/mach-omap2
parent3c5902d270edb6ccc3049acfe5d3e96653c87dcd (diff)
downloadlinux-c3f244d5776ecd236657fc1c4b7c5d1d4d01ca7e.tar.xz
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>
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r--arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c b/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c
index 70892b3da28d..edf046b470ba 100644
--- a/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c
+++ b/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c
@@ -235,7 +235,7 @@ void omap2xxx_clkt_vps_init(void)
hw = kzalloc(sizeof(*hw), GFP_KERNEL);
if (!hw)
- goto cleanup;
+ return;
init.name = "virt_prcm_set";
init.ops = &virt_prcm_set_ops;
init.parent_names = &parent_name;
@@ -251,8 +251,5 @@ void omap2xxx_clkt_vps_init(void)
}
clkdev_create(clk, "cpufreq_ck", NULL);
- return;
-cleanup:
- kfree(hw);
}
#endif