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]
Date:   Thu,  1 Dec 2022 18:55:24 +0100
From:   Lucas Stach <l.stach@...gutronix.de>
To:     linux-usb@...r.kernel.org, netdev@...r.kernel.org
Cc:     "David S . Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>, kernel@...gutronix.de,
        patchwork-lst@...gutronix.de
Subject: [PATCH 1/2] net: asix: Simplify return value check after asix_check_host_enable

Any negative return value from this function is indicative of an
error. Simplify the condition to cover all possible error codes.

Signed-off-by: Lucas Stach <l.stach@...gutronix.de>
---
 drivers/net/usb/asix_common.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/usb/asix_common.c b/drivers/net/usb/asix_common.c
index 72ffc89b477a..be1e103b7a95 100644
--- a/drivers/net/usb/asix_common.c
+++ b/drivers/net/usb/asix_common.c
@@ -504,7 +504,7 @@ static int __asix_mdio_read(struct net_device *netdev, int phy_id, int loc,
 	mutex_lock(&dev->phy_mutex);
 
 	ret = asix_check_host_enable(dev, in_pm);
-	if (ret == -ENODEV || ret == -ETIMEDOUT) {
+	if (ret < 0) {
 		mutex_unlock(&dev->phy_mutex);
 		return ret;
 	}
@@ -542,7 +542,7 @@ static int __asix_mdio_write(struct net_device *netdev, int phy_id, int loc,
 	mutex_lock(&dev->phy_mutex);
 
 	ret = asix_check_host_enable(dev, in_pm);
-	if (ret == -ENODEV)
+	if (ret < 0)
 		goto out;
 
 	ret = asix_write_cmd(dev, AX_CMD_WRITE_MII_REG, phy_id, (__u16)loc, 2,
-- 
2.30.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ