mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mike Christie <michael.christie@oracle.com>
To: Dinghao Liu <dinghao.liu@zju.edu.cn>
Cc: Ketan Mukadam <ketan.mukadam@broadcom.com>,
	"James E.J. Bottomley" <jejb@linux.ibm.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	John Soni Jose <sony.john-n@emulex.com>,
	Jayamohan Kallickal <jayamohank@gmail.com>,
	James Bottomley <JBottomley@Parallels.com>,
	Mike Christie <michaelc@cs.wisc.edu>,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] scsi: be2iscsi: fix a memleak in beiscsi_init_wrb_handle
Date: Mon, 27 Nov 2023 15:26:38 -0600	[thread overview]
Message-ID: <b760bf11-c8a7-4f9f-b2c5-2e35e84e46d2@oracle.com> (raw)
In-Reply-To: <20231123081941.24854-1-dinghao.liu@zju.edu.cn>

On 11/23/23 2:19 AM, Dinghao Liu wrote:
> When an error occurs in the for loop of beiscsi_init_wrb_handle(),
> we should free phwi_ctxt->be_wrbq before returning an error code
> to prevent potential memleak.
> 
> Fixes: a7909b396ba7 ("[SCSI] be2iscsi: Fix dynamic CID allocation Mechanism in driver")
> Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
> ---
>  drivers/scsi/be2iscsi/be_main.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
> index e48f14ad6dfd..06acb5ff609e 100644
> --- a/drivers/scsi/be2iscsi/be_main.c
> +++ b/drivers/scsi/be2iscsi/be_main.c
> @@ -2710,6 +2710,7 @@ static int beiscsi_init_wrb_handle(struct beiscsi_hba *phba)
>  		kfree(pwrb_context->pwrb_handle_base);
>  		kfree(pwrb_context->pwrb_handle_basestd);
>  	}
> +	kfree(phwi_ctxt->be_wrbq);
>  	return -ENOMEM;
>  }
>  

Reviewed-by: Mike Christie <michael.christie@oracle.com>

  reply	other threads:[~2023-11-27 21:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-23  8:19 Dinghao Liu
2023-11-27 21:26 ` Mike Christie [this message]
2023-12-06  3:15 ` Martin K. Petersen

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=b760bf11-c8a7-4f9f-b2c5-2e35e84e46d2@oracle.com \
    --to=michael.christie@oracle.com \
    --cc=JBottomley@Parallels.com \
    --cc=dinghao.liu@zju.edu.cn \
    --cc=jayamohank@gmail.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 \
    --cc=michaelc@cs.wisc.edu \
    --cc=sony.john-n@emulex.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 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®