Skip to content

Commit e6d736b

Browse files
abhijitG-xlnxjgunthorpe
authored andcommitted
RDMA/ionic: Fix memory leak of admin q_wr
The admin queue work request buffer, aq->q_wr, is allocated via kcalloc in __ionic_create_rdma_adminq. However, it was not being freed in the corresponding teardown function __ionic_destroy_rdma_adminq. This results in a memory leak. Fix this leak by adding the missing kfree(aq->q_wr) in the destruction path. Fixes: f3bdbd4 ("RDMA/ionic: Create device queues to support admin operations") Link: https://patch.msgid.link/r/[email protected] Signed-off-by: Abhijit Gangurde <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent fdd0fe9 commit e6d736b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/infiniband/hw/ionic/ionic_admin.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,7 @@ static struct ionic_aq *__ionic_create_rdma_adminq(struct ionic_ibdev *dev,
600600
static void __ionic_destroy_rdma_adminq(struct ionic_ibdev *dev,
601601
struct ionic_aq *aq)
602602
{
603+
kfree(aq->q_wr);
603604
ionic_queue_destroy(&aq->q, dev->lif_cfg.hwdev);
604605
kfree(aq);
605606
}

0 commit comments

Comments
 (0)