kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Andrew Lunn <andrew@lunn.ch>, Yang Yingliang <yangyingliang@huawei.com>
Cc: Vivien Didelot <vivien.didelot@gmail.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Vladimir Oltean <olteanv@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	netdev@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [PATCH 2/2 net-next] net: dsa: qca8k: check the correct variable in qca8k_set_mac_eee()
Date: Wed, 9 Jun 2021 12:53:03 +0300	[thread overview]
Message-ID: <YMCPf8lVosAYayXo@mwanda> (raw)
In-Reply-To: <YMCPTLkZumD3Vv/X@mwanda>

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@oracle.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, &reg);
-	if (reg < 0) {
-		ret = reg;
+	if (ret < 0)
 		goto exit;
-	}
 
 	if (eee->eee_enabled)
 		reg |= lpi_en;
-- 
2.30.2


  reply	other threads:[~2021-06-09  9:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-09  9:52 [PATCH 1/2 net-next] net: dsa: qca8k: fix an endian bug in qca8k_get_ethtool_stats() Dan Carpenter
2021-06-09  9:53 ` Dan Carpenter [this message]
2021-06-09 13:48   ` [PATCH 2/2 net-next] net: dsa: qca8k: check the correct variable in qca8k_set_mac_eee() Vladimir Oltean
2021-06-09 13:44 ` [PATCH 1/2 net-next] net: dsa: qca8k: fix an endian bug in qca8k_get_ethtool_stats() Vladimir Oltean
2021-06-09 21:20 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YMCPf8lVosAYayXo@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=vivien.didelot@gmail.com \
    --cc=yangyingliang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).