scsi: smartpqi: Fix rare SAS transport memory leak
authorDon Brace <don.brace@microchip.com>
Fri, 28 Apr 2023 15:37:04 +0000 (10:37 -0500)
committerMartin K. Petersen <martin.petersen@oracle.com>
Mon, 8 May 2023 11:17:11 +0000 (07:17 -0400)
commit2312e844dc8d5fd66f179baa3d848d2613e4f81f
tree1ab94fcdec650583227c38ded03423fdf871454e
parent889cda36db99e3ef0c9a6d2e6c64de725913394b
scsi: smartpqi: Fix rare SAS transport memory leak

Free rphy when pqi_sas_port_add_rphy() returns an error.

If pqi_sas_port_add_rphy() returns an error, the 'rphy' allocated in
sas_end_device_alloc() needs to be freed.

It should be noted that no issues were ever reported.

Reviewed-by: Scott Benesh <scott.benesh@microchip.com>
Reviewed-by: Scott Teel <scott.teel@microchip.com>
Reviewed-by: Mike McGowen <mike.mcgowen@microchip.com>
Reviewed-by: Kevin Barnett <kevin.barnett@microchip.com>
Suggested-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Don Brace <don.brace@microchip.com>
Link: https://lore.kernel.org/r/20230428153712.297638-5-don.brace@microchip.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/smartpqi/smartpqi_sas_transport.c