Re: [PATCH] scsi: lpfc: fix potential memory leak in lpfc_read_object()

From: Abdun Nihaal

Date: Wed May 20 2026 - 02:10:25 EST


Hello Justin,

On Tue, May 19, 2026 at 12:52:36PM -0700, Justin Tee wrote:
> > The memory allocated for sge_array inside lpfc_sli4_config() which is
> > attached to mbox, is not freed in one of the error path in
> > lpfc_read_object(). Fix that by calling lpfc_sli4_mbox_cmd_free()
> > instead of directly freeing the mbox.
>
> I don’t believe this is true because in lpfc_read_object(),
> lpfc_sli4_config() is called with LPFC_SLI4_MBX_EMBED.  So, sge_array is not
> kzalloc’ed.  The code as it is today seems already correct without this
> patch.

Thanks for your review. You are right. I had overlooked the conditional
and the early branch in lpfc_sli4_config(). There is no memory leak
here. Please ignore this patch.

Regards,
Nihaal