summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMajd Dibbiny <majd@mellanox.com>2016-10-27 16:36:39 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-11-26 09:56:58 +0100
commit32091ee63d17a8eaaa25a9bcd99d12d236f2b603 (patch)
treebaa7503db6e3f647d508b27fe363b037ed58407c /drivers
parent21822a5bbddd7c097e8822b6f762c697f1fc6558 (diff)
IB/mlx5: Fix memory leak in query device
commit 90be7c8ab72853ff9fc407f01518a898df1f3045 upstream. We need to free dev->port when we fail to enable RoCE or initialize node data. Fixes: 0837e86a7a34 ('IB/mlx5: Add per port counters') Signed-off-by: Majd Dibbiny <majd@mellanox.com> Signed-off-by: Maor Gottlieb <maorg@mellanox.com> Reviewed-by: Mark Bloch <markb@mellanox.com> Signed-off-by: Leon Romanovsky <leon@kernel.org> Signed-off-by: Doug Ledford <dledford@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/infiniband/hw/mlx5/main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
index bff8707a2f1f..8a65eb1a6345 100644
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@ -2835,7 +2835,7 @@ static void *mlx5_ib_add(struct mlx5_core_dev *mdev)
}
err = init_node_data(dev);
if (err)
- goto err_dealloc;
+ goto err_free_port;
mutex_init(&dev->flow_db.lock);
mutex_init(&dev->cap_mask_mutex);
@@ -2845,7 +2845,7 @@ static void *mlx5_ib_add(struct mlx5_core_dev *mdev)
if (ll == IB_LINK_LAYER_ETHERNET) {
err = mlx5_enable_roce(dev);
if (err)
- goto err_dealloc;
+ goto err_free_port;
}
err = create_dev_resources(&dev->devr);