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

From: Justin Tee

Date: Tue May 19 2026 - 15:58:30 EST


Hi Abdun,

> 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.

Regards,
Justin