lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1536975230-185101-1-git-send-email-weiyongjun1@huawei.com>
Date:   Sat, 15 Sep 2018 01:33:50 +0000
From:   Wei Yongjun <weiyongjun1@...wei.com>
To:     Hauke Mehrtens <hauke@...ke-m.de>
CC:     Wei Yongjun <weiyongjun1@...wei.com>, <netdev@...r.kernel.org>,
        <kernel-janitors@...r.kernel.org>
Subject: [PATCH net-next] 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@...wei.com>
---
 drivers/net/ethernet/lantiq_xrx200.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/lantiq_xrx200.c b/drivers/net/ethernet/lantiq_xrx200.c
index c8b6d90..4a16076 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");

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ