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>] [day] [month] [year] [list]
Message-Id: <20211224051254.1565040-1-jiasheng@iscas.ac.cn>
Date:   Fri, 24 Dec 2021 13:12:54 +0800
From:   Jiasheng Jiang <jiasheng@...as.ac.cn>
To:     davem@...emloft.net, kuba@...nel.org, colin.king@...el.com
Cc:     netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        Jiasheng Jiang <jiasheng@...as.ac.cn>
Subject: [PATCH] drivers: net: smc911x: Fix wrong check for irq

Because ndev->irq is unsigned, the check is useless.
Therefore, we need to correct the check by using error variable.

Fixes: cb93b3e11d40 ("drivers: net: smc911x: Check for error irq")
Signed-off-by: Jiasheng Jiang <jiasheng@...as.ac.cn>
---
 drivers/net/ethernet/smsc/smc911x.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/smsc/smc911x.c b/drivers/net/ethernet/smsc/smc911x.c
index dd6f69ced4ee..3118c8b7a8c3 100644
--- a/drivers/net/ethernet/smsc/smc911x.c
+++ b/drivers/net/ethernet/smsc/smc911x.c
@@ -2071,11 +2071,11 @@ static int smc911x_drv_probe(struct platform_device *pdev)
 	SET_NETDEV_DEV(ndev, &pdev->dev);
 
 	ndev->dma = (unsigned char)-1;
-	ndev->irq = platform_get_irq(pdev, 0);
-	if (ndev->irq < 0) {
-		ret = ndev->irq;
+
+	ret = platform_get_irq(pdev, 0);
+	if (ret < 0)
 		goto release_both;
-	}
+	ndev->irq = ret;
 
 	lp = netdev_priv(ndev);
 	lp->netdev = ndev;
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ