]> git.baikalelectronics.ru Git - kernel.git/commit
net: sgi: ioc3-eth: Fix return value check in ioc3eth_probe()
authorTang Bin <tangbin@cmss.chinamobile.com>
Wed, 20 May 2020 09:55:32 +0000 (17:55 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 22 May 2020 00:26:54 +0000 (17:26 -0700)
commit3def847c4817ab101a42bdf50d0fb80746045772
tree1035541121ddc67b58de30c1f632a07f8926d89a
parentaaab5aa4fbef23446ced6c93c95e44a34b4a8569
net: sgi: ioc3-eth: Fix return value check in ioc3eth_probe()

In the function devm_platform_ioremap_resource(), if get resource
failed, the return value is ERR_PTR() not NULL. Thus it must be
replaced by IS_ERR(), or else it may result in crashes if a critical
error path is encountered.

Fixes: 593eec2361d6 ("mfd: ioc3: Add driver for SGI IOC3 chip")
Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/sgi/ioc3-eth.c