Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: f3bdbd42702c ("RDMA/ionic: Create device queues to support admin operations")
Link: https://patch.msgid.link/r/20250924142123.18344-1-abhijit.gangurde@amd.com
Signed-off-by: Abhijit Gangurde <abhijit.gangurde@amd.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>

authored by

Abhijit Gangurde and committed by
Jason Gunthorpe
e6d736bd fdd0fe94

+1
+1
drivers/infiniband/hw/ionic/ionic_admin.c
··· 600 600 static void __ionic_destroy_rdma_adminq(struct ionic_ibdev *dev, 601 601 struct ionic_aq *aq) 602 602 { 603 + kfree(aq->q_wr); 603 604 ionic_queue_destroy(&aq->q, dev->lif_cfg.hwdev); 604 605 kfree(aq); 605 606 }