diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2021-06-09 12:53:03 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-06-10 00:10:38 +0300 |
commit | 3d0167f2a627528032821cdeb78b4eab0510460f (patch) | |
tree | 7541a607faaa4101f0ba22490e156d5d3286637e /drivers/net/dsa | |
parent | aa3d020b22cb844ab7bdbb9e5d861a64666e2b74 (diff) | |
download | linux-3d0167f2a627528032821cdeb78b4eab0510460f.tar.xz |
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@oracle.com>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa')
-rw-r--r-- | drivers/net/dsa/qca8k.c | 4 |
1 files changed, 1 insertions, 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; |