Skip to content

Commit

Permalink
net/irda: sh_sir: fix return value check in sh_sir_set_baudrate()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wei Yongjun authored and David S. Miller committed Sep 21, 2012
1 parent 6861509 commit dc9c975
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/irda/sh_sir.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit dc9c975

Please sign in to comment.