Commit cb0ceaf7 authored by Vladimir Zapolskiy's avatar Vladimir Zapolskiy Committed by Stephen Boyd

clk: at91: fix check of clk_register() returned value

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: default avatarVladimir Zapolskiy <vz@mleia.com>
Acked-by: default avatarAlexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
Fixes: bcc5fd49 ("clk: at91: add a driver for the h32mx clock")
Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
parent d31d56ec
......@@ -114,7 +114,7 @@ static void __init of_sama5d4_clk_h32mx_setup(struct device_node *np)
h32mxclk->regmap = regmap;
clk = clk_register(NULL, &h32mxclk->hw);
if (!clk) {
if (IS_ERR(clk)) {
kfree(h32mxclk);
return;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment