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

"Milan P. Gandhi" <[email protected]> Wed, 12 Aug 2026 16:03:42 +0530
Newsgroups gmane.linux.scsi
Message-ID <[email protected]>
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(+)

-- 
2.55.0