linux/drivers/scsi/smartpqi
Don Brace 5cad5a5072 scsi: smartpqi: Fix device pointer variable reference static checker issue
Dan Carpenter found a possible NULL pointer dereference issue in function
pqi_sas_port_add_rphy():

   drivers/scsi/smartpqi/smartpqi_sas_transport.c:97
   pqi_sas_port_add_rphy() warn: variable dereferenced before
   check 'pqi_sas_port->device' (see line 95)

Correct issue by moving reference of pqi_sas_port->device after the check
for the device pointer being non-NULL.

Link: https://www.mail-archive.com/kbuild@lists.01.org/msg06329.html
Link: https://lore.kernel.org/r/161850493026.7302.10032784239320437353.stgit@brunhilda
Fixes: ec504b23df ("scsi: smartpqi: Add phy ID support for the physical drives")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Reported-by: kernel test robot <lkp@intel.com>
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>
Signed-off-by: Don Brace <don.brace@microchip.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-04-15 22:03:32 -04:00
..
Kconfig scsi: smartpqi: Update copyright 2020-09-02 22:49:06 -04:00
Makefile scsi: smartpqi: add spdx 2019-03-18 16:48:28 -04:00
smartpqi_init.c scsi: smartpqi: Fix blocks_per_row static checker issue 2021-04-15 22:03:32 -04:00
smartpqi_sas_transport.c scsi: smartpqi: Fix device pointer variable reference static checker issue 2021-04-15 22:03:32 -04:00
smartpqi_sis.c scsi: smartpqi: Align code with oob driver 2021-04-05 23:02:29 -04:00
smartpqi_sis.h scsi: smartpqi: Add support for new product ids 2021-04-05 23:02:28 -04:00
smartpqi.h scsi: smartpqi: Add phy ID support for the physical drives 2021-04-05 23:02:32 -04:00