Re: [PATCH 0/2] scsi: mpi3mr: Fix error handling and resource leak in mpi3mr_sas_port_add()

Laurence Oberman <[email protected]> Wed, 12 Aug 2026 08:59:41 -0400
Newsgroups gmane.linux.scsi
Message-ID <[email protected]>
On Wed, 2026-08-12 at 16:03 +0530, Milan P. Gandhi wrote:
> This series fixes resource leaks and potential crashes in the
> mpi3mr_sas_port_add() error path:
> 
> - Patch 1 adds a missing NULL check on sas_port_alloc_num() failure
>   and ensures allocated ports are released via sas_port_free() if
>   sas_port_add() fails.
> - Patch 2 releases the target device reference acquired via
>   mpi3mr_get_tgtdev_by_addr() if subsequent allocation errors occur.
> 
> Milan P. Gandhi (2):
>   scsi: mpi3mr: Fix NULL pointer dereference in mpi3mr_sas_port_add()
>   scsi: mpi3mr: Fix target device refcount leak in
> mpi3mr_sas_port_add()
> 
>  drivers/scsi/mpi3mr/mpi3mr_transport.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
Given the Sashiko reports were pre-existing issues:
For this series it looks good.

Reviewed-by: Laurence Oberman <[email protected]>