Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6cc070bd authored by Dan Carpenter's avatar Dan Carpenter Committed by Leon Romanovsky
Browse files

net/mlx5: potential error pointer dereference in error handling



The error handling was a bit flipped around.  If the mlx5_create_flow_group()
function failed then it would have resulted in dereferencing "fg" when
it was an error pointer.

Fixes: 80f09dfc ("net/mlx5: Eswitch, enable RoCE loopback traffic")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
parent a188339c
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -106,10 +106,10 @@ static int mlx5_rdma_enable_roce_steering(struct mlx5_core_dev *dev)


	return 0;
	return 0;


destroy_flow_table:
	mlx5_destroy_flow_table(ft);
destroy_flow_group:
destroy_flow_group:
	mlx5_destroy_flow_group(fg);
	mlx5_destroy_flow_group(fg);
destroy_flow_table:
	mlx5_destroy_flow_table(ft);
free:
free:
	kvfree(spec);
	kvfree(spec);
	kvfree(flow_group_in);
	kvfree(flow_group_in);