mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Abdun Nihaal <nihaal@cse.iitm.ac.in>,
	linux-scsi@vger.kernel.org, Justin Tee <justin.tee@broadcom.com>
Cc: stable@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
	James Bottomley <James.Bottomley@HansenPartnership.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	Paul Ely <paul.ely@broadcom.com>
Subject: Re: [PATCH] scsi: lpfc: Fix memory leak in lpfc_sli4_driver_resource_setup()
Date: Fri, 10 Jul 2026 20:00:16 +0200	[thread overview]
Message-ID: <e9ecb5d3-cb77-43b0-ae75-f15a28bc86c6@web.de> (raw)
In-Reply-To: <20260707065304.949135-1-nihaal@cse.iitm.ac.in>

> The memory allocated for mboxq using mempool_alloc() is not freed in
> some of the early exit error paths. Fix that by moving the
> mempool_free() call to an earlier point after last use.
…
> +++ b/drivers/scsi/lpfc/lpfc_init.c
> @@ -8189,6 +8189,7 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba)
>  		mempool_free(mboxq, phba->mbox_mem_pool);
>  		goto out_free_bsmbx;
>  	}
> +	mempool_free(mboxq, phba->mbox_mem_pool);
>  
>  	/*
>  	 * 1 for cmd, 1 for rsp, NVME adds an extra one

How do you think about to move the mempool_free() call directly behind
the statement “rc = lpfc_get_sli4_parameters(phba, mboxq);”?
https://elixir.bootlin.com/linux/v7.2-rc2/source/drivers/scsi/lpfc/lpfc_init.c#L8180-L8191

Regards,
Markus

  parent reply	other threads:[~2026-07-10 18:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-07  6:53 Abdun Nihaal
2026-07-07 17:00 ` Justin Tee
2026-07-10 18:00 ` Markus Elfring [this message]
2026-07-10 21:20   ` Justin Tee
2026-07-13  2:32 ` 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=e9ecb5d3-cb77-43b0-ae75-f15a28bc86c6@web.de \
    --to=markus.elfring@web.de \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=justin.tee@broadcom.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=nihaal@cse.iitm.ac.in \
    --cc=paul.ely@broadcom.com \
    --cc=stable@vger.kernel.org \
    /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®