From: Colin Ian King Date: Wed, 4 Sep 2019 19:29:14 +0000 (+0100) Subject: net/mlx5: fix missing assignment of variable err X-Git-Tag: v5.4-rc1~131^2~55^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e53e665558eea32e76585c3d3a5786e7298045ad;p=thirdparty%2Fkernel%2Flinux.git net/mlx5: fix missing assignment of variable err 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 Signed-off-by: Saeed Mahameed --- diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c index afa623b15a381..00d71db15f221 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c @@ -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;