mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-03 09:04:21 +08:00
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: 9645ccc7bd
("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>
This commit is contained in:
parent
3e11194631
commit
8a7322a3a0
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user