All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jianglei Nie <niejianglei2021@163.com>
To: ketan.mukadam@broadcom.com, jejb@linux.ibm.com,
	martin.petersen@oracle.com
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	Jianglei Nie <niejianglei2021@163.com>
Subject: [PATCH] scsi: be2iscsi: fix potential memory leak in beiscsi_process_mcc_compl()
Date: Thu, 26 May 2022 16:57:21 +0800	[thread overview]
Message-ID: <20220526085721.481202-1-niejianglei2021@163.com> (raw)

We should call free_mcc_wrb() before the function returns.This patch
adds the missing free_mcc_wrb() before the funciton returns.

Signed-off-by: Jianglei Nie <niejianglei2021@163.com>
---
 drivers/scsi/be2iscsi/be_cmds.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/be2iscsi/be_cmds.c b/drivers/scsi/be2iscsi/be_cmds.c
index 69b1a80e3687..d07107a0bf41 100644
--- a/drivers/scsi/be2iscsi/be_cmds.c
+++ b/drivers/scsi/be2iscsi/be_cmds.c
@@ -498,6 +498,7 @@ int beiscsi_process_mcc_compl(struct be_ctrl_info *ctrl,
 		beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_MBOX |
 			    BEISCSI_LOG_INIT | BEISCSI_LOG_CONFIG,
 			    "BC_%d : MBX cmd completed but not posted\n");
+		free_mcc_wrb(ctrl, tag);
 		return 0;
 	}
 
-- 
2.25.1


                 reply	other threads:[~2022-05-26  8:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220526085721.481202-1-niejianglei2021@163.com \
    --to=niejianglei2021@163.com \
    --cc=jejb@linux.ibm.com \
    --cc=ketan.mukadam@broadcom.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.