net/mlx5e: Fix error flow in tx reporter diagnose
authorAya Levin <ayal@mellanox.com>
Sun, 30 Jun 2019 08:11:26 +0000 (11:11 +0300)
committerSaeed Mahameed <saeedm@mellanox.com>
Thu, 11 Jul 2019 18:45:04 +0000 (11:45 -0700)
Fix tx reporter's diagnose callback. Propagate error when failing to
gather diagnostics information or failing to print diagnostic data per
queue.

Fixes: de8650a82071 ("net/mlx5e: Add tx reporter support")
Signed-off-by: Aya Levin <ayal@mellanox.com>
Reviewed-by: Tariq Toukan <tariqt@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c

index a778c15e53241ccb3561d9221ac830c444a51502..f3d98748b2117575ad64c83b2bb962ec7a718786 100644 (file)
@@ -262,13 +262,13 @@ static int mlx5e_tx_reporter_diagnose(struct devlink_health_reporter *reporter,
 
                err = mlx5_core_query_sq_state(priv->mdev, sq->sqn, &state);
                if (err)
-                       break;
+                       goto unlock;
 
                err = mlx5e_tx_reporter_build_diagnose_output(fmsg, sq->sqn,
                                                              state,
                                                              netif_xmit_stopped(sq->txq));
                if (err)
-                       break;
+                       goto unlock;
        }
        err = devlink_fmsg_arr_pair_nest_end(fmsg);
        if (err)