RDMA/mlx5: Fix memory leak in case we fail to add an IB device
authorMark Bloch <markb@mellanox.com>
Mon, 11 Feb 2019 15:40:54 +0000 (17:40 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Jan 2020 13:50:22 +0000 (14:50 +0100)
commit0ed24039e2c98062e638c6030c17ebe569ca426a
tree88ccfbd1cef97980598ff382866cab6ebe709771
parentb9f664809bd59d70d2e2a49559d54dbb242d6392
RDMA/mlx5: Fix memory leak in case we fail to add an IB device

[ Upstream commit fc9e4477f924e84d7798f7a1d41401d699de1219 ]

Make sure the IB device is freed on failure.

Fixes: b5ca15ad7e61 ("IB/mlx5: Add proper representors support")
Signed-off-by: Mark Bloch <markb@mellanox.com>
Reviewed-by: Bodong Wang <bodong@mellanox.com>
Reviewed-by: HÃ¥kon Bugge <haakon.bugge@oracle.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/hw/mlx5/ib_rep.c