diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2012-09-20 17:13:55 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-09-21 13:47:24 -0400 |
commit | dc9c9759ebc65d886453c335b2b5be39f87ab01e (patch) | |
tree | e22f582f886455db89bcd9023e0bbdff8b7945f1 /drivers/net/irda | |
parent | 6861509f9fee9c5e568c5f6852bb96f2475b4179 (diff) |
net/irda: sh_sir: fix return value check in sh_sir_set_baudrate()
In case of error, the function clk_get() returns ERR_PTR()
and never returns NULL pointer. The NULL test in the error
handling should be replaced with IS_ERR().
dpatch engine is used to auto generated this patch.
(https://github.com/weiyj/dpatch)
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/irda')
-rw-r--r-- | drivers/net/irda/sh_sir.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/irda/sh_sir.c b/drivers/net/irda/sh_sir.c index 256eddf1f75a..795109425568 100644 --- a/drivers/net/irda/sh_sir.c +++ b/drivers/net/irda/sh_sir.c | |||
@@ -280,7 +280,7 @@ static int sh_sir_set_baudrate(struct sh_sir_self *self, u32 baudrate) | |||
280 | } | 280 | } |
281 | 281 | ||
282 | clk = clk_get(NULL, "irda_clk"); | 282 | clk = clk_get(NULL, "irda_clk"); |
283 | if (!clk) { | 283 | if (IS_ERR(clk)) { |
284 | dev_err(dev, "can not get irda_clk\n"); | 284 | dev_err(dev, "can not get irda_clk\n"); |
285 | return -EIO; | 285 | return -EIO; |
286 | } | 286 | } |