diff mbox series

[next] net/mlx5: fix missing assignment of variable err

Message ID 20190904192914.19684-1-colin.king@canonical.com (mailing list archive)
State Not Applicable
Headers show
Series [next] net/mlx5: fix missing assignment of variable err | expand

Commit Message

Colin King Sept. 4, 2019, 7:29 p.m. UTC
From: Colin Ian King <colin.king@canonical.com>

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>
---
 drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Saeed Mahameed Sept. 4, 2019, 11:30 p.m. UTC | #1
On Wed, 2019-09-04 at 20:29 +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> 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>
> ---

Applied to net-next-mlx5.

I have a cleanup series coming up, will send it all together to 
net-next soon. 

Thanks,
Saeed.
diff mbox series

Patch

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
index afa623b15a38..00d71db15f22 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;