Commit 6905e5a5 authored by Dan Carpenter's avatar Dan Carpenter Committed by David S. Miller

net/mlx5e: IPoIB, Fix error handling in mlx5_rdma_netdev_alloc()

The labels were out of order, so it either could result in an Oops or a
leak.

Fixes: 48935bbb ("net/mlx5e: IPoIB, Add netdevice profile skeleton")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Acked-by: default avatarLeon Romanovsky <leonro@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f6ca26f2
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment