[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220419014439.2561835-1-lv.ruyi@zte.com.cn>
Date: Tue, 19 Apr 2022 01:44:39 +0000
From: cgel.zte@...il.com
To: f.fainelli@...il.com, bcm-kernel-feedback-list@...adcom.com,
andrew@...n.ch
Cc: hkallweit1@...il.com, linux@...linux.org.uk, davem@...emloft.net,
kuba@...nel.org, pabeni@...hat.com, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, Lv Ruyi <lv.ruyi@....com.cn>,
Zeal Robot <zealci@....com.cn>
Subject: [PATCH] net: phy: fix error check return value of phy_read()
From: Lv Ruyi <lv.ruyi@....com.cn>
phy_read() returns a negative number if there's an error, but the
error-checking code in the bcm87xx driver's config_intr function
triggers if phy_read() returns non-zero. Correct that.
Reported-by: Zeal Robot <zealci@....com.cn>
Signed-off-by: Lv Ruyi <lv.ruyi@....com.cn>
---
drivers/net/phy/bcm87xx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/phy/bcm87xx.c b/drivers/net/phy/bcm87xx.c
index 313563482690..e62b53718010 100644
--- a/drivers/net/phy/bcm87xx.c
+++ b/drivers/net/phy/bcm87xx.c
@@ -146,7 +146,7 @@ static int bcm87xx_config_intr(struct phy_device *phydev)
if (phydev->interrupts == PHY_INTERRUPT_ENABLED) {
err = phy_read(phydev, BCM87XX_LASI_STATUS);
- if (err)
+ if (err < 0)
return err;
reg |= 1;
--
2.25.1
Powered by blists - more mailing lists