Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5d44adeb authored by Danit Goldberg's avatar Danit Goldberg Committed by Jason Gunthorpe
Browse files

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: <stable@vger.kernel.org>
Fixes: 32f69e4b ("{net, IB}/mlx5: Manage port association for multiport RoCE")
Link: https://lore.kernel.org/r/20190916064818.19823-3-leon@kernel.org


Signed-off-by: default avatarDanit Goldberg <danitg@mellanox.com>
Reviewed-by: default avatarJason Gunthorpe <jgg@mellanox.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent 130c2c57
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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;
	}