Skip to content

Commit

Permalink
clk: at91: fix check of clk_register() returned value
Browse files Browse the repository at this point in the history
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: bcc5fd4 ("clk: at91: add a driver for the h32mx clock")
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
  • Loading branch information
Vladimir Zapolskiy authored and Stephen Boyd committed Apr 15, 2016
1 parent d31d56e commit cb0ceaf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/clk/at91/clk-h32mx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit cb0ceaf

Please sign in to comment.