From: James Smart <jsmart2021@gmail.com>
To: Rafael Mendonca <rafaelmendsr@gmail.com>,
James Smart <james.smart@broadcom.com>,
Dick Kennedy <dick.kennedy@broadcom.com>,
"James E.J. Bottomley" <jejb@linux.ibm.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
Gaurav Srivastava <gaurav.srivastava@broadcom.com>,
Hannes Reinecke <hare@suse.de>,
Muneendra Kumar <muneendra.kumar@broadcom.com>
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] scsi: lpfc: Fix memory leak in lpfc_create_port()
Date: Sun, 2 Oct 2022 09:48:46 -0700 [thread overview]
Message-ID: <8f30bdb4-05b9-d85c-cf78-80f8589ffeb5@gmail.com> (raw)
In-Reply-To: <20220916035908.712799-1-rafaelmendsr@gmail.com>
On 9/15/2022 8:59 PM, Rafael Mendonca wrote:
> Commit 5e633302ace1 ("scsi: lpfc: vmid: Add support for VMID in mailbox
> command") introduced allocations for the VMID resources in
> lpfc_create_port() after the call to scsi_host_alloc(). Upon failure on the
> VMID allocations, the new code would branch to the 'out' label, which
> returns NULL without unwinding anything, thus skipping the call to
> scsi_host_put().
>
> Fix the problem by creating a separate label 'out_free_vmid' to unwind the
> VMID resources and make the 'out_put_shost' label call only
> scsi_host_put(), as was done before the introduction of allocations for
> VMID.
>
> Fixes: 5e633302ace1 ("scsi: lpfc: vmid: Add support for VMID in mailbox command")
> Signed-off-by: Rafael Mendonca <rafaelmendsr@gmail.com>
> ---
> drivers/scsi/lpfc/lpfc_init.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
Looks good
Reviewed-by: James Smart <jsmart2021@gmail.com>
-- james
next prev parent reply other threads:[~2022-10-02 16:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-16 3:59 Rafael Mendonca
2022-10-01 10:01 ` Martin K. Petersen
2022-10-02 16:48 ` James Smart [this message]
2022-10-18 3:52 ` 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=8f30bdb4-05b9-d85c-cf78-80f8589ffeb5@gmail.com \
--to=jsmart2021@gmail.com \
--cc=dick.kennedy@broadcom.com \
--cc=gaurav.srivastava@broadcom.com \
--cc=hare@suse.de \
--cc=james.smart@broadcom.com \
--cc=jejb@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=muneendra.kumar@broadcom.com \
--cc=rafaelmendsr@gmail.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®