summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/lantiq_xrx200.c
diff options
context:
space:
mode:
authorWei Yongjun <weiyongjun1@huawei.com>2018-09-15 01:33:50 +0000
committerDavid S. Miller <davem@davemloft.net>2018-09-17 08:06:41 -0700
commitb8b2de91e9dbb89bf4c34a860b04e53a1b1416bf (patch)
tree1d243cd1f8bdfda9887afd58adbca6e1584cc5e1 /drivers/net/ethernet/lantiq_xrx200.c
parentf592e0b9895cd6f04ba2771a3903317dd7c1ba31 (diff)
net: lantiq: Fix return value check in xrx200_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(). Fixes: fe1a56420cf2 ("net: lantiq: Add Lantiq / Intel VRX200 Ethernet driver") Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Acked-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/lantiq_xrx200.c')
-rw-r--r--drivers/net/ethernet/lantiq_xrx200.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/lantiq_xrx200.c b/drivers/net/ethernet/lantiq_xrx200.c
index c8b6d908f0cc..4a160761b3ff 100644
--- a/drivers/net/ethernet/lantiq_xrx200.c
+++ b/drivers/net/ethernet/lantiq_xrx200.c
@@ -461,9 +461,9 @@ static int xrx200_probe(struct platform_device *pdev)
}
priv->pmac_reg = devm_ioremap_resource(dev, res);
- if (!priv->pmac_reg) {
+ if (IS_ERR(priv->pmac_reg)) {
dev_err(dev, "failed to request and remap io ranges\n");
- return -ENOMEM;
+ return PTR_ERR(priv->pmac_reg);
}
priv->chan_rx.dma.irq = platform_get_irq_byname(pdev, "rx");