mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 01:10:04 +00:00
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>
This commit is contained in:
parent
6861509f9f
commit
dc9c9759eb
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue