mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH rdma-next 1/1] RDMA/ionic: Fix memory leak of admin q_wr
@ 2025-09-24 14:21 Abhijit Gangurde
  2025-09-26 16:15 ` Jason Gunthorpe
  0 siblings, 1 reply; 2+ messages in thread
From: Abhijit Gangurde @ 2025-09-24 14:21 UTC (permalink / raw)
  To: jgg, leon
  Cc: allen.hubbe, nikhil.agarwal, linux-rdma, linux-kernel, Abhijit Gangurde

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")
Signed-off-by: Abhijit Gangurde <abhijit.gangurde@amd.com>
---
 drivers/infiniband/hw/ionic/ionic_admin.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/infiniband/hw/ionic/ionic_admin.c b/drivers/infiniband/hw/ionic/ionic_admin.c
index c2ff21bcd96f..2537aa55d12d 100644
--- a/drivers/infiniband/hw/ionic/ionic_admin.c
+++ b/drivers/infiniband/hw/ionic/ionic_admin.c
@@ -600,6 +600,7 @@ static struct ionic_aq *__ionic_create_rdma_adminq(struct ionic_ibdev *dev,
 static void __ionic_destroy_rdma_adminq(struct ionic_ibdev *dev,
 					struct ionic_aq *aq)
 {
+	kfree(aq->q_wr);
 	ionic_queue_destroy(&aq->q, dev->lif_cfg.hwdev);
 	kfree(aq);
 }

base-commit: 9b9e32f75aa3d257e3ee3ab0a0f9ad5fbfb298af
-- 
2.43.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH rdma-next 1/1] RDMA/ionic: Fix memory leak of admin q_wr
  2025-09-24 14:21 [PATCH rdma-next 1/1] RDMA/ionic: Fix memory leak of admin q_wr Abhijit Gangurde
@ 2025-09-26 16:15 ` Jason Gunthorpe
  0 siblings, 0 replies; 2+ messages in thread
From: Jason Gunthorpe @ 2025-09-26 16:15 UTC (permalink / raw)
  To: Abhijit Gangurde
  Cc: leon, allen.hubbe, nikhil.agarwal, linux-rdma, linux-kernel

On Wed, Sep 24, 2025 at 07:51:23PM +0530, Abhijit Gangurde wrote:
> 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")
> Signed-off-by: Abhijit Gangurde <abhijit.gangurde@amd.com>
> ---
>  drivers/infiniband/hw/ionic/ionic_admin.c | 1 +
>  1 file changed, 1 insertion(+)

Applied to for-next, thanks

Jason

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-09-26 16:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-24 14:21 [PATCH rdma-next 1/1] RDMA/ionic: Fix memory leak of admin q_wr Abhijit Gangurde
2025-09-26 16:15 ` Jason Gunthorpe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®