]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
bcm63xx_enet: fix return value check in bcm_enet_shared_probe()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Wed, 19 Jun 2013 02:32:32 +0000 (10:32 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 19 Jun 2013 07:48:58 +0000 (00:48 -0700)
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>
drivers/net/ethernet/broadcom/bcm63xx_enet.c

index 8f1ac023bb033b79f5b4a49df78f77b7597fa0a5..b1bcd4ba47444e0f36c1bc4f9d8a2ff446ba5882 100644 (file)
@@ -2862,8 +2862,8 @@ static int bcm_enet_shared_probe(struct platform_device *pdev)
        for (i = 0; i < 3; i++) {
                res = platform_get_resource(pdev, IORESOURCE_MEM, i);
                p[i] = devm_ioremap_resource(&pdev->dev, res);
-               if (!p[i])
-                       return -ENOMEM;
+               if (IS_ERR(p[i]))
+                       return PTR_ERR(p[i]);
        }
 
        memcpy(bcm_enet_shared_base, p, sizeof(bcm_enet_shared_base));