浏览代码

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>
Wei Yongjun 7 年之前
父节点
当前提交
b8b2de91e9
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      drivers/net/ethernet/lantiq_xrx200.c

+ 2 - 2
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");