Skip to content

scsi: mpi3mr: Fix error handling and resource leak in mpi3mr_sas_port_add()

Milan P. Gandhi linux-scsi lkml sashiko-reviews 1 version Applied

Status from this message: Applied to 7.3/scsi-staging, thanks!

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 4 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/2scsi: mpi3mr: Fix NULL pointer dereference in mpi3mr_sas_port_add()drivers/scsi/mpi3mr/mpi3mr_transport.c+6 -01 reply
2/2scsi: mpi3mr: Fix target device refcount leak in mpi3mr_sas_port_add()drivers/scsi/mpi3mr/mpi3mr_transport.c+2 -00 replies

Reviews trailers per patch

None of the 2 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchLaurence Oberman
SeriesR-b
1/2
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

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

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(+)
Signature · 1 line
2.55.0