net/mlx5: fix missing assignment of variable err
authorColin Ian King <colin.king@canonical.com>
Wed, 4 Sep 2019 19:29:14 +0000 (20:29 +0100)
committerSaeed Mahameed <saeedm@mellanox.com>
Thu, 5 Sep 2019 21:44:41 +0000 (14:44 -0700)
The error return from a call to mlx5_flow_namespace_set_peer is not
being assigned to variable err and hence the error check following
the call is currently not working.  Fix this by assigning ret as
intended.

Addresses-Coverity: ("Logically dead code")
Fixes: 8463daf17e80 ("net/mlx5: Add support to use SMFS in switchdev mode")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c

index afa623b15a3817c7ab6313589da5978cc82fb960..00d71db15f2217f437b4d8438d1a8087d35ab080 100644 (file)
@@ -1651,7 +1651,7 @@ static int mlx5_esw_offloads_set_ns_peer(struct mlx5_eswitch *esw,
                if (err)
                        return err;
 
-               mlx5_flow_namespace_set_peer(peer_ns, ns);
+               err = mlx5_flow_namespace_set_peer(peer_ns, ns);
                if (err) {
                        mlx5_flow_namespace_set_peer(ns, NULL);
                        return err;