mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] scsi: mpt3sas: fix a potential memory leak in scsih_pci_slot_reset()
@ 2026-01-25 16:12 Haoxiang Li
  2026-01-26  4:17 ` kernel test robot
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Haoxiang Li @ 2026-01-25 16:12 UTC (permalink / raw)
  To: sathya.prakash, sreekanth.reddy, suganath-prabu.subramani,
	James.Bottomley, martin.petersen
  Cc: MPT-FusionLinux.pdl, linux-scsi, linux-kernel, Haoxiang Li

In scsih_pci_slot_reset(), if mpt3sas_base_hard_reset_handler()
fails, call mpt3sas_base_unmap_resources() to release the memory
allocated by mpt3sas_base_map_resources().

Signed-off-by: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
---
 drivers/scsi/mpt3sas/mpt3sas_scsih.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
index 7092d0debef3..7a884a278163 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -12529,8 +12529,9 @@ scsih_pci_slot_reset(struct pci_dev *pdev)
 
 	if (!rc)
 		return PCI_ERS_RESULT_RECOVERED;
-	else
-		return PCI_ERS_RESULT_DISCONNECT;
+
+	mpt3sas_base_unmap_resources(ioc);
+	return PCI_ERS_RESULT_DISCONNECT;
 }
 
 /**
-- 
2.25.1


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

end of thread, other threads:[~2026-01-26  5:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-25 16:12 [PATCH] scsi: mpt3sas: fix a potential memory leak in scsih_pci_slot_reset() Haoxiang Li
2026-01-26  4:17 ` kernel test robot
2026-01-26  5:19 ` kernel test robot
2026-01-26  5:20 ` kernel test robot

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®