summaryrefslogtreecommitdiff
path: root/arch/arm/mach-ep93xx
diff options
context:
space:
mode:
authorGenjian Zhang <zhanggenjian123@gmail.com>2022-05-17 10:39:46 +0300
committerArnd Bergmann <arnd@arndb.de>2022-05-27 16:55:44 +0300
commit8a7322a3a05f75e8a4902bdf8129aecd37d54fe9 (patch)
tree92524973c6cc4124c6de8f61e6ec8c2a05ff0572 /arch/arm/mach-ep93xx
parent3e11194631275937bc40da49b98aa1a74dd1ee67 (diff)
downloadlinux-8a7322a3a05f75e8a4902bdf8129aecd37d54fe9.tar.xz
ep93xx: clock: Do not return the address of the freed memory
Avoid return freed memory addresses,Modified to the actual error return value of clk_register(). Fixes: 9645ccc7bd7a ("ep93xx: clock: convert in-place to COMMON_CLK") Signed-off-by: Genjian Zhang <zhanggenjian@kylinos.cn> Acked-by: Alexander Sverdlin <alexander.sverdlin@gmail.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/arm/mach-ep93xx')
-rw-r--r--arch/arm/mach-ep93xx/clock.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/arm/mach-ep93xx/clock.c b/arch/arm/mach-ep93xx/clock.c
index 4fa6ea5461b7..85a496ddc619 100644
--- a/arch/arm/mach-ep93xx/clock.c
+++ b/arch/arm/mach-ep93xx/clock.c
@@ -345,9 +345,10 @@ static struct clk_hw *clk_hw_register_ddiv(const char *name,
psc->hw.init = &init;
clk = clk_register(NULL, &psc->hw);
- if (IS_ERR(clk))
+ if (IS_ERR(clk)) {
kfree(psc);
-
+ return ERR_CAST(clk);
+ }
return &psc->hw;
}
@@ -452,9 +453,10 @@ static struct clk_hw *clk_hw_register_div(const char *name,
psc->hw.init = &init;
clk = clk_register(NULL, &psc->hw);
- if (IS_ERR(clk))
+ if (IS_ERR(clk)) {
kfree(psc);
-
+ return ERR_CAST(clk);
+ }
return &psc->hw;
}