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: <20230901070443.1308314-1-ruanjinjie@huawei.com>
Date: Fri, 1 Sep 2023 15:04:43 +0800
From: Jinjie Ruan <ruanjinjie@...wei.com>
To: <bcm-kernel-feedback-list@...adcom.com>, <netdev@...r.kernel.org>, Justin
 Chen <justin.chen@...adcom.com>, Florian Fainelli
	<florian.fainelli@...adcom.com>, "David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Paolo
 Abeni <pabeni@...hat.com>, Simon Horman <horms@...nel.org>
CC: <ruanjinjie@...wei.com>
Subject: [PATCH net-next] net: bcmasp: Do not check for 0 return after calling platform_get_irq()

It is not possible for platform_get_irq() to return 0. And it return
-EINVAL when the irq = 0 and -ENXIO when the irq can not be found. The
best practice is to return the err code from platform_get_irq().

Fixes: 490cb412007d ("net: bcmasp: Add support for ASP2.0 Ethernet controller")
Signed-off-by: Jinjie Ruan <ruanjinjie@...wei.com>
---
 drivers/net/ethernet/broadcom/asp2/bcmasp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/asp2/bcmasp.c b/drivers/net/ethernet/broadcom/asp2/bcmasp.c
index d63d321f3e7b..05b07da03398 100644
--- a/drivers/net/ethernet/broadcom/asp2/bcmasp.c
+++ b/drivers/net/ethernet/broadcom/asp2/bcmasp.c
@@ -1231,8 +1231,8 @@ static int bcmasp_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	priv->irq = platform_get_irq(pdev, 0);
-	if (priv->irq <= 0)
-		return -EINVAL;
+	if (priv->irq < 0)
+		return priv->irq;
 
 	priv->clk = devm_clk_get_optional_enabled(dev, "sw_asp");
 	if (IS_ERR(priv->clk))
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ