mirror of
https://github.com/torvalds/linux.git
synced 2026-06-07 14:04:54 +02:00
clk: at91: fix check of clk_register() returned value
commitcb0ceaf77dupstream. The clk_register() function returns a valid pointer to struct clk or ERR_PTR() error code, this makes a check for returned NULL value useless and may lead to oops on error path. Signed-off-by: Vladimir Zapolskiy <vz@mleia.com> Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com> Fixes:bcc5fd49a0("clk: at91: add a driver for the h32mx clock") Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
d529842900
commit
4ee87930e4
|
|
@ -116,7 +116,7 @@ void __init of_sama5d4_clk_h32mx_setup(struct device_node *np,
|
|||
h32mxclk->pmc = pmc;
|
||||
|
||||
clk = clk_register(NULL, &h32mxclk->hw);
|
||||
if (!clk) {
|
||||
if (IS_ERR(clk)) {
|
||||
kfree(h32mxclk);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user