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-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1512409703-20881-3-git-send-email-arvind.yadav.cs@gmail.com>
Date:   Mon,  4 Dec 2017 23:18:18 +0530
From:   Arvind Yadav <arvind.yadav.cs@...il.com>
To:     wg@...ndegger.com, mkl@...gutronix.de, michal.simek@...inx.com,
        opendmb@...il.com, f.fainelli@...il.com, davem@...emloft.net
Cc:     linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        netdev@...r.kernel.org
Subject: [PATCH 2/7 v2] net: ezchip: nps_enet: Fix platform_get_irq's error checking

The platform_get_irq() function returns negative number if an error
occurs, Zero if No irq is found and positive number if irq gets successful.
platform_get_irq() error checking only for zero is not correct.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@...il.com>
---
changes in v2:
             commit message was not correct.

 drivers/net/ethernet/ezchip/nps_enet.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/ezchip/nps_enet.c b/drivers/net/ethernet/ezchip/nps_enet.c
index 659f1ad..7d4b628 100644
--- a/drivers/net/ethernet/ezchip/nps_enet.c
+++ b/drivers/net/ethernet/ezchip/nps_enet.c
@@ -623,9 +623,9 @@ static s32 nps_enet_probe(struct platform_device *pdev)
 
 	/* Get IRQ number */
 	priv->irq = platform_get_irq(pdev, 0);
-	if (!priv->irq) {
+	if (priv->irq <= 0) {
 		dev_err(dev, "failed to retrieve <irq Rx-Tx> value from device tree\n");
-		err = -ENODEV;
+		err = priv->irq ? priv->irq : -ENODEV;
 		goto out_netdev;
 	}
 
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ