Message ID | YMCPf8lVosAYayXo@mwanda (mailing list archive) |
---|---|
State | Accepted |
Commit | 3d0167f2a627528032821cdeb78b4eab0510460f |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [1/2,net-next] net: dsa: qca8k: fix an endian bug in qca8k_get_ethtool_stats() | expand |
Context | Check | Description |
---|---|---|
netdev/cover_letter | success | Link |
netdev/fixes_present | success | Link |
netdev/patch_count | success | Link |
netdev/tree_selection | success | Clearly marked for net-next |
netdev/subject_prefix | success | Link |
netdev/cc_maintainers | success | CCed 8 of 8 maintainers |
netdev/source_inline | success | Was 0 now: 0 |
netdev/verify_signedoff | success | Link |
netdev/module_param | success | Was 0 now: 0 |
netdev/build_32bit | success | Errors and warnings before: 0 this patch: 0 |
netdev/kdoc | success | Errors and warnings before: 0 this patch: 0 |
netdev/verify_fixes | success | Link |
netdev/checkpatch | success | total: 0 errors, 0 warnings, 0 checks, 11 lines checked |
netdev/build_allmodconfig_warn | success | Errors and warnings before: 0 this patch: 0 |
netdev/header_inline | success | Link |
On Wed, Jun 09, 2021 at 12:53:03PM +0300, Dan Carpenter wrote: > 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>
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;
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(-)