c58f79cd8b81f79e7de9625df05a547040239133
[openwrt/staging/ldir.git] /
1 From 3d0167f2a627528032821cdeb78b4eab0510460f Mon Sep 17 00:00:00 2001
2 From: Dan Carpenter <dan.carpenter@oracle.com>
3 Date: Wed, 9 Jun 2021 12:53:03 +0300
4 Subject: [PATCH] net: dsa: qca8k: check the correct variable in
5 qca8k_set_mac_eee()
6
7 This code check "reg" but "ret" was intended so the error handling will
8 never trigger.
9
10 Fixes: 7c9896e37807 ("net: dsa: qca8k: check return value of read functions correctly")
11 Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
12 Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
13 Signed-off-by: David S. Miller <davem@davemloft.net>
14 ---
15 drivers/net/dsa/qca8k.c | 4 +---
16 1 file changed, 1 insertion(+), 3 deletions(-)
17
18 --- a/drivers/net/dsa/qca8k.c
19 +++ b/drivers/net/dsa/qca8k.c
20 @@ -1454,10 +1454,8 @@ qca8k_set_mac_eee(struct dsa_switch *ds,
21
22 mutex_lock(&priv->reg_mutex);
23 ret = qca8k_read(priv, QCA8K_REG_EEE_CTRL, &reg);
24 - if (reg < 0) {
25 - ret = reg;
26 + if (ret < 0)
27 goto exit;
28 - }
29
30 if (eee->eee_enabled)
31 reg |= lpi_en;