summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2017-04-19 12:59:15 +0300
committerDavid S. Miller <davem@davemloft.net>2017-04-20 16:26:10 -0400
commit6905e5a5c8d552ace1d65cacb43499a0eb1e0b89 (patch)
tree6a6c835224714334a78de23dc60b89fca99dfa8d /drivers
parentf6ca26f26837f90727a1450f010a1638834e34e1 (diff)
downloadlwn-6905e5a5c8d552ace1d65cacb43499a0eb1e0b89.tar.gz
lwn-6905e5a5c8d552ace1d65cacb43499a0eb1e0b89.zip
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: 48935bbb7ae8 ("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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/ipoib.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/ipoib.c b/drivers/net/ethernet/mellanox/mlx5/core/ipoib.c
index 001d2953cb6d..ec78e637840f 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/ipoib.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/ipoib.c
@@ -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);