ARM: ep93xx: clock: Do not return the address of the freed memory
Alexander Sverdlin
maintainerPATCH 1/1 ARM: ep93xx: clock: Do not return the address of the freed memory
From: Genjian Zhang <[email protected]>
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 <[email protected]>
[AS: Added "ARM:" prefix, punctuation]
Signed-off-by Alexander Sverdlin <[email protected]>
--- arch/arm/mach-ep93xx/clock.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
arch/arm/mach-ep93xx/clock.c +6 -4
@@ -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; }
Signature · 1 line
2.36.0
This patch was applied to soc/soc.git (for-next) by Arnd Bergmann <[email protected]>:
Hello:
This patch was applied to soc/soc.git (for-next)
by Arnd Bergmann <[email protected]>:
Quoted 11 lines · On Mon, 23 May 2022 07:04:21 +0200 you wrote:
From: Genjian Zhang <[email protected]>
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 <[email protected]>[AS: Added "ARM:" prefix, punctuation]Signed-off-by Alexander Sverdlin <[email protected]>[...]
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!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html