Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

bcm63xx_enet: fix return value check in bcm_enet_shared_probe()

In case of error, the function devm_ioremap_resource() returns ERR_PTR()
and never returns NULL. The NULL test in the return value check should
be replaced with IS_ERR().

Introduce by commit 0ae99b5fede6f3a8d252d50bb4aba29544295219
(bcm63xx_enet: split DMA channel register accesses)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Wei Yongjun and committed by
David S. Miller
646093a2 a267a604

+2 -2
+2 -2
drivers/net/ethernet/broadcom/bcm63xx_enet.c
··· 2862 2862 for (i = 0; i < 3; i++) { 2863 2863 res = platform_get_resource(pdev, IORESOURCE_MEM, i); 2864 2864 p[i] = devm_ioremap_resource(&pdev->dev, res); 2865 - if (!p[i]) 2866 - return -ENOMEM; 2865 + if (IS_ERR(p[i])) 2866 + return PTR_ERR(p[i]); 2867 2867 } 2868 2868 2869 2869 memcpy(bcm_enet_shared_base, p, sizeof(bcm_enet_shared_base));