net/mlx5: potential error pointer dereference in error handling
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 3 May 2019 12:28:39 +0000 (15:28 +0300)
committerLeon Romanovsky <leonro@mellanox.com>
Tue, 28 May 2019 14:35:06 +0000 (17:35 +0300)
commit6cc070bdf07c8f6d5955d43da0560c9e5fd203b1
tree590f158e23f7646dc447e01e7adbb8471eceb82e
parenta188339ca5a396acc588e5851ed7e19f66b0ebd9
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: 80f09dfc237f ("net/mlx5: Eswitch, enable RoCE loopback traffic")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/rdma.c