[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YMCPf8lVosAYayXo@mwanda>
Date: Wed, 9 Jun 2021 12:53:03 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Andrew Lunn <andrew@...n.ch>,
Yang Yingliang <yangyingliang@...wei.com>
Cc: Vivien Didelot <vivien.didelot@...il.com>,
Florian Fainelli <f.fainelli@...il.com>,
Vladimir Oltean <olteanv@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>, netdev@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: [PATCH 2/2 net-next] net: dsa: qca8k: check the correct variable in
qca8k_set_mac_eee()
This code check "reg" but "ret" was intended so the error handling will
never trigger.
Fixes: 7c9896e37807 ("net: dsa: qca8k: check return value of read functions correctly")
Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
---
drivers/net/dsa/qca8k.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/net/dsa/qca8k.c b/drivers/net/dsa/qca8k.c
index 9df3514d1ff2..1f63f50f73f1 100644
--- a/drivers/net/dsa/qca8k.c
+++ b/drivers/net/dsa/qca8k.c
@@ -1454,10 +1454,8 @@ qca8k_set_mac_eee(struct dsa_switch *ds, int port, struct ethtool_eee *eee)
mutex_lock(&priv->reg_mutex);
ret = qca8k_read(priv, QCA8K_REG_EEE_CTRL, ®);
- if (reg < 0) {
- ret = reg;
+ if (ret < 0)
goto exit;
- }
if (eee->eee_enabled)
reg |= lpi_en;
--
2.30.2
Powered by blists - more mailing lists