Commit 3d0167f2 authored by Dan Carpenter's avatar Dan Carpenter Committed by David S. Miller

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: 7c9896e3 ("net: dsa: qca8k: check return value of read functions correctly")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: default avatarVladimir Oltean <olteanv@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent aa3d020b
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment