* [PATCH] ARM: ep93xx: clock: Do not return the address of the freed memory
@ 2022-05-23 5:04 Alexander Sverdlin
2022-05-26 14:40 ` patchwork-bot+linux-soc
0 siblings, 1 reply; 2+ messages in thread
From: Alexander Sverdlin @ 2022-05-23 5:04 UTC (permalink / raw)
To: soc; +Cc: Genjian Zhang, Genjian Zhang, Alexander Sverdlin
From: Genjian Zhang <zhanggenjian123@gmail.com>
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>
[AS: Added "ARM:" prefix, punctuation]
Signed-off-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
---
arch/arm/mach-ep93xx/clock.c | 10 ++++++----
1 file 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;
}
--
2.36.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ARM: ep93xx: clock: Do not return the address of the freed memory
2022-05-23 5:04 [PATCH] ARM: ep93xx: clock: Do not return the address of the freed memory Alexander Sverdlin
@ 2022-05-26 14:40 ` patchwork-bot+linux-soc
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+linux-soc @ 2022-05-26 14:40 UTC (permalink / raw)
To: Alexander Sverdlin; +Cc: soc
Hello:
This patch was applied to soc/soc.git (for-next)
by Arnd Bergmann <arnd@arndb.de>:
On Mon, 23 May 2022 07:04:21 +0200 you wrote:
> From: Genjian Zhang <zhanggenjian123@gmail.com>
>
> 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>
> [AS: Added "ARM:" prefix, punctuation]
> Signed-off-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
>
> [...]
Here is the summary with links:
- ARM: ep93xx: clock: Do not return the address of the freed memory
https://git.kernel.org/soc/soc/c/201155540334
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-05-26 14:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-23 5:04 [PATCH] ARM: ep93xx: clock: Do not return the address of the freed memory Alexander Sverdlin
2022-05-26 14:40 ` patchwork-bot+linux-soc
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.