mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] scsi: be2iscsi: fix a memory leak in beiscsi_boot_get_sinfo()
@ 2025-12-13  8:36 Haoxiang Li
  2025-12-20 16:09 ` Markus Elfring
  2026-01-24  3:53 ` Martin K. Petersen
  0 siblings, 2 replies; 3+ messages in thread
From: Haoxiang Li @ 2025-12-13  8:36 UTC (permalink / raw)
  To: ketan.mukadam, James.Bottomley, martin.petersen, jitendra.bhivare, hare
  Cc: linux-scsi, linux-kernel, Haoxiang Li, stable

If nonemb_cmd->va fails to be allocated, call free_mcc_wrb()
to restore the impact caused by alloc_mcc_wrb().

Fixes: 50a4b824be9e ("scsi: be2iscsi: Fix to make boot discovery non-blocking")
Cc: stable@vger.kernel.org
Signed-off-by: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
---
 drivers/scsi/be2iscsi/be_mgmt.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/be2iscsi/be_mgmt.c b/drivers/scsi/be2iscsi/be_mgmt.c
index 4e899ec1477d..b1cba986f0fb 100644
--- a/drivers/scsi/be2iscsi/be_mgmt.c
+++ b/drivers/scsi/be2iscsi/be_mgmt.c
@@ -1025,6 +1025,7 @@ unsigned int beiscsi_boot_get_sinfo(struct beiscsi_hba *phba)
 					      &nonemb_cmd->dma,
 					      GFP_KERNEL);
 	if (!nonemb_cmd->va) {
+		free_mcc_wrb(ctrl, tag);
 		mutex_unlock(&ctrl->mbox_lock);
 		return 0;
 	}
-- 
2.25.1


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

end of thread, other threads:[~2026-01-24  3:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-13  8:36 [PATCH] scsi: be2iscsi: fix a memory leak in beiscsi_boot_get_sinfo() Haoxiang Li
2025-12-20 16:09 ` Markus Elfring
2026-01-24  3:53 ` Martin K. Petersen

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®