aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanit Goldberg <[email protected]>2019-09-16 09:48:18 +0300
committerJason Gunthorpe <[email protected]>2019-09-16 14:08:18 -0300
commit5d44adebbb7e785939df3db36ac360f5e8b73e44 (patch)
treef4b0b13cf33de34a8aca6f528d115c966bf03887
parent130c2c576e75efaea9cd321ec4b171cc93cd0030 (diff)
IB/mlx5: Free mpi in mp_slave mode
ib_add_slave_port() allocates a multiport struct but never frees it. Don't leak memory, free the allocated mpi struct during driver unload. Cc: <[email protected]> Fixes: 32f69e4be269 ("{net, IB}/mlx5: Manage port association for multiport RoCE") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Danit Goldberg <[email protected]> Reviewed-by: Jason Gunthorpe <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
-rw-r--r--drivers/infiniband/hw/mlx5/main.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
index c6bc4aee7638..6fedfff7862a 100644
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@ -6999,6 +6999,7 @@ static void mlx5_ib_remove(struct mlx5_core_dev *mdev, void *context)
mlx5_ib_unbind_slave_port(mpi->ibdev, mpi);
list_del(&mpi->list);
mutex_unlock(&mlx5_ib_multiport_mutex);
+ kfree(mpi);
return;
}