diff mbox

[net-next] net/mlx5e: IPoIB, Fix error handling in mlx5_rdma_netdev_alloc()

Message ID 20170419095914.GB4266@mwanda (mailing list archive)
State Not Applicable
Headers show

Commit Message

Dan Carpenter April 19, 2017, 9:59 a.m. UTC
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>

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Leon Romanovsky April 19, 2017, 10:11 a.m. UTC | #1
On Wed, Apr 19, 2017 at 12:59:15PM +0300, Dan Carpenter wrote:
> 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>
>

Thanks,
Acked-by: Leon Romanovsky <leonro@mellanox.com>
David Miller April 20, 2017, 8:28 p.m. UTC | #2
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Wed, 19 Apr 2017 12:59:15 +0300

> 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>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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);