public inbox for linux-clk@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clk: at91: fix check of clk_register() returned value
@ 2016-03-07 23:41 Vladimir Zapolskiy
  2016-03-08  3:06 ` Alexandre Belloni
  2016-04-15 23:57 ` Stephen Boyd
  0 siblings, 2 replies; 4+ messages in thread
From: Vladimir Zapolskiy @ 2016-03-07 23:41 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Boris Brezillon,
	Alexandre Belloni
  Cc: linux-clk

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>
---
Alexandre, Boris,

I've seen your recent huge updates to the driver, but I haven't found
them in clk-next, I hope that this trivial fix against clk-next won't
cause a big pain on rebase.

 drivers/clk/at91/clk-h32mx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/at91/clk-h32mx.c b/drivers/clk/at91/clk-h32mx.c
index 61566bc..a165230 100644
--- a/drivers/clk/at91/clk-h32mx.c
+++ b/drivers/clk/at91/clk-h32mx.c
@@ -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;
 	}
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-04-15 23:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-07 23:41 [PATCH] clk: at91: fix check of clk_register() returned value Vladimir Zapolskiy
2016-03-08  3:06 ` Alexandre Belloni
2016-03-08 11:33   ` Boris Brezillon
2016-04-15 23:57 ` Stephen Boyd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox