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: <20211125075432.26636-1-tangbin@cmss.chinamobile.com>
Date:   Thu, 25 Nov 2021 15:54:32 +0800
From:   Tang Bin <tangbin@...s.chinamobile.com>
To:     davem@...emloft.net, kuba@...nel.org
Cc:     netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        Tang Bin <tangbin@...s.chinamobile.com>
Subject: [PATCH] ptp: ixp46x: Fix error handling in ptp_ixp_probe()

In the function ptp_ixp_probe(), when get irq failed
after executing platform_get_irq(), the negative value
returned will not be detected here. So fix error handling
in this place.

Fixes: 9055a2f591629 ("ixp4xx_eth: make ptp support a platform driver")
Signed-off-by: Tang Bin <tangbin@...s.chinamobile.com>
---
 drivers/net/ethernet/xscale/ptp_ixp46x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/xscale/ptp_ixp46x.c b/drivers/net/ethernet/xscale/ptp_ixp46x.c
index 39234852e01b..c52e01d89e47 100644
--- a/drivers/net/ethernet/xscale/ptp_ixp46x.c
+++ b/drivers/net/ethernet/xscale/ptp_ixp46x.c
@@ -272,7 +272,7 @@ static int ptp_ixp_probe(struct platform_device *pdev)
 	ixp_clock.master_irq = platform_get_irq(pdev, 0);
 	ixp_clock.slave_irq = platform_get_irq(pdev, 1);
 	if (IS_ERR(ixp_clock.regs) ||
-	    !ixp_clock.master_irq || !ixp_clock.slave_irq)
+	    (ixp_clock.master_irq < 0) || (ixp_clock.slave_irq < 0))
 		return -ENXIO;
 
 	ixp_clock.caps = ptp_ixp_caps;
-- 
2.18.2



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ