Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1506645

[PATCH] clk: keystone: Fix an error checking

From Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Newsgroups linux.kernel
Subject [PATCH] clk: keystone: Fix an error checking
Date 2016-10-23 10:20 +0200
Message-ID <svmaB-6Vi-5@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


clk_register_pll() can return ERR_PTR(-ENOMEM) so here the check against
NULL only is not correct.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
Un-compiled and un-tested.
---
 drivers/clk/keystone/pll.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/keystone/pll.c b/drivers/clk/keystone/pll.c
index a26ba2184454..b936029fa211 100644
--- a/drivers/clk/keystone/pll.c
+++ b/drivers/clk/keystone/pll.c
@@ -213,7 +213,7 @@ static void __init _of_pll_clk_init(struct device_node *node, bool pllctrl)
 	}
 
 	clk = clk_register_pll(NULL, node->name, parent_name, pll_data);
-	if (clk) {
+	if (!IS_ERR_OR_NULL(clk)) {
 		of_clk_add_provider(node, of_clk_src_simple_get, clk);
 		return;
 	}
-- 
2.9.3

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH] clk: keystone: Fix an error checking Christophe JAILLET <christophe.jaillet@wanadoo.fr> - 2016-10-23 10:20 +0200
  Re: [PATCH] clk: keystone: Fix an error checking Dan Carpenter <dan.carpenter@oracle.com> - 2016-10-24 12:40 +0200
    Re: [PATCH] clk: keystone: Fix an error checking Lars-Peter Clausen <lars@metafoo.de> - 2016-10-24 12:50 +0200
      Re: [PATCH] clk: keystone: Fix an error checking Christophe JAILLET <christophe.jaillet@wanadoo.fr> - 2016-10-24 22:20 +0200

csiph-web