Skip to content

Commit

Permalink
net/mlx5e: IPoIB, Fix error handling in mlx5_rdma_netdev_alloc()
Browse files Browse the repository at this point in the history
The labels were out of order, so it either could result in an Oops or a
leak.

Fixes: 48935bb ("net/mlx5e: IPoIB, Add netdevice profile skeleton")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Dan Carpenter authored and davem330 committed Apr 20, 2017
1 parent f6ca26f commit 6905e5a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/net/ethernet/mellanox/mlx5/core/ipoib.c
Original file line number Diff line number Diff line change
Expand Up @@ -471,10 +471,11 @@ struct net_device *mlx5_rdma_netdev_alloc(struct mlx5_core_dev *mdev,
*/
return netdev;

free_mdev_resources:
mlx5e_destroy_mdev_resources(mdev);
err_free_netdev:
free_netdev(netdev);
free_mdev_resources:
mlx5e_destroy_mdev_resources(mdev);

return NULL;
}
EXPORT_SYMBOL(mlx5_rdma_netdev_alloc);
Expand Down

0 comments on commit 6905e5a

Please sign in to comment.