netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net/irda: sh_sir: fix return value check in sh_sir_set_baudrate()
@ 2012-09-21  7:13 Wei Yongjun
  2012-09-21 17:47 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2012-09-21  7:13 UTC (permalink / raw)
  To: samuel; +Cc: yongjun_wei, netdev

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

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>
---
 drivers/net/irda/sh_sir.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/irda/sh_sir.c b/drivers/net/irda/sh_sir.c
index 256eddf..7951094 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)
 	}
 
 	clk = clk_get(NULL, "irda_clk");
-	if (!clk) {
+	if (IS_ERR(clk)) {
 		dev_err(dev, "can not get irda_clk\n");
 		return -EIO;
 	}

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

* Re: [PATCH] net/irda: sh_sir: fix return value check in sh_sir_set_baudrate()
  2012-09-21  7:13 [PATCH] net/irda: sh_sir: fix return value check in sh_sir_set_baudrate() Wei Yongjun
@ 2012-09-21 17:47 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2012-09-21 17:47 UTC (permalink / raw)
  To: weiyj.lk; +Cc: samuel, yongjun_wei, netdev

From: Wei Yongjun <weiyj.lk@gmail.com>
Date: Fri, 21 Sep 2012 15:13:55 +0800

> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> 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>

Applied.

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

end of thread, other threads:[~2012-09-21 17:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-21  7:13 [PATCH] net/irda: sh_sir: fix return value check in sh_sir_set_baudrate() Wei Yongjun
2012-09-21 17:47 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).