[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20251228125852.3690161-1-zilin@seu.edu.cn>
Date: Sun, 28 Dec 2025 12:58:52 +0000
From: Zilin Guan <zilin@....edu.cn>
To: sathya.prakash@...adcom.com
Cc: sreekanth.reddy@...adcom.com,
suganath-prabu.subramani@...adcom.com,
James.Bottomley@...senPartnership.com,
martin.petersen@...cle.com,
MPT-FusionLinux.pdl@...adcom.com,
linux-scsi@...r.kernel.org,
linux-kernel@...r.kernel.org,
Zilin Guan <zilin@....edu.cn>,
Jianhao Xu <jianhao.xu@....edu.cn>
Subject: [PATCH] scsi: mpt3sas: Fix memory leak in _base_enable_msix()
In _base_enable_msix(), if _base_alloc_irq_vectors() fails, the function
jumps to the try_ioapic label without freeing the allocated
ioc->io_uring_poll_queues, leading to a memory leak.
Fix this by freeing ioc->io_uring_poll_queues before jumping to
try_ioapic.
Fixes: 1d55abc0e98a ("scsi: mpt3sas: switch to pci_alloc_irq_vectors")
Co-developed-by: Jianhao Xu <jianhao.xu@....edu.cn>
Signed-off-by: Jianhao Xu <jianhao.xu@....edu.cn>
Signed-off-by: Zilin Guan <zilin@....edu.cn>
---
drivers/scsi/mpt3sas/mpt3sas_base.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c
index 0d652db8fe24..2b7f823fb4cb 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -3507,6 +3507,7 @@ _base_enable_msix(struct MPT3SAS_ADAPTER *ioc)
r = _base_alloc_irq_vectors(ioc);
if (r < 0) {
ioc_info(ioc, "pci_alloc_irq_vectors failed (r=%d) !!!\n", r);
+ kfree(ioc->io_uring_poll_queues);
goto try_ioapic;
}
--
2.34.1
Powered by blists - more mailing lists