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

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>

authored by

Wei Yongjun and committed by
David S. Miller
b8b2de91 f592e0b9

+2 -2
+2 -2
drivers/net/ethernet/lantiq_xrx200.c
··· 461 461 } 462 462 463 463 priv->pmac_reg = devm_ioremap_resource(dev, res); 464 - if (!priv->pmac_reg) { 464 + if (IS_ERR(priv->pmac_reg)) { 465 465 dev_err(dev, "failed to request and remap io ranges\n"); 466 - return -ENOMEM; 466 + return PTR_ERR(priv->pmac_reg); 467 467 } 468 468 469 469 priv->chan_rx.dma.irq = platform_get_irq_byname(pdev, "rx");