From: Leon Romanovsky <leonro@xxxxxxxxxx> Destroy XArray while releasing qedr resources. Fixes: b6014f9e5f39 ("qedr: Convert qpidr to XArray") Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxx> --- I'm sending it to -rc just because of dependency on https://lore.kernel.org/linux-rdma/166687129991.306571.17052575958640789335.b4-ty@xxxxxxxxxx/T/#m0e945baa7f2c87ede9f1711c992889602ede7875 qps is empty and nothing is really leaked here. --- drivers/infiniband/hw/qedr/main.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/hw/qedr/main.c b/drivers/infiniband/hw/qedr/main.c index ba0c3e4c07d8..9f53afed2bd0 100644 --- a/drivers/infiniband/hw/qedr/main.c +++ b/drivers/infiniband/hw/qedr/main.c @@ -308,8 +308,10 @@ static void qedr_free_resources(struct qedr_dev *dev) { int i; - if (IS_IWARP(dev)) + if (IS_IWARP(dev)) { destroy_workqueue(dev->iwarp_wq); + xa_destroy(&dev->qps); + } for (i = 0; i < dev->num_cnq; i++) { qedr_free_mem_sb(dev, &dev->sb_array[i], dev->sb_start + i); @@ -407,8 +409,10 @@ static int qedr_alloc_resources(struct qedr_dev *dev) err2: kfree(dev->sb_array); err_destroy_wq: - if (IS_IWARP(dev)) + if (IS_IWARP(dev)) { destroy_workqueue(dev->iwarp_wq); + xa_destroy(&dev->qps); + } err1: kfree(dev->sgid_tbl); return rc; -- 2.37.3