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://<email address hidden>/msg06329.html
Link: https://lore.kernel.org/r/161850493026.7302.10032784239320437353.stgit@brunhilda
Fixes: ec504b23df9d ("scsi: smartpqi: Add phy ID support for the physical drives")
Reported-by: Dan Carpenter <email address hidden>
Reported-by: kernel test robot <email address hidden>
Reviewed-by: Scott Benesh <email address hidden>
Reviewed-by: Scott Teel <email address hidden>
Reviewed-by: Mike McGowen <email address hidden>
Reviewed-by: Kevin Barnett <email address hidden>
Signed-off-by: Don Brace <email address hidden>
Signed-off-by: Martin K. Petersen <email address hidden>
(cherry picked from commit 5cad5a507241b4b72b7cad27cf769ac645e53d45)
Signed-off-by: Krzysztof Kozlowski <email address hidden>
Dan Carpenter found a possible divide by 0 issue in the smartpqi driver in
functions pci_get_aio_common_raid_map_values() and pqi_calc_aio_r5_or_r6().
The variable rmd->blocks_per_row is used as a divisor and could be 0.
Using rmd->blocks_per_row as a divisor without checking
it for 0 first.
Correct these possible divide by 0 conditions by insuring that
rmd->blocks_per_row is not zero before usage. The check for non-0 was too
late to prevent a divide by 0 condition. Add in a comment to explain why
the check for non-zero is necessary. If the member is 0, return
PQI_RAID_BYPASS_INELIGIBLE before any division is performed.
Link: https://lore.kernel.org/linux-scsi/YG%2F5kWHHAr7w5dU5@mwanda/
Link: https://lore.kernel.org/r/161850492435.7302.392780350442938047.stgit@brunhilda
Fixes: 6702d2c40f31 ("scsi: smartpqi: Add support for RAID5 and RAID6 writes")
Reported-by: Dan Carpenter <email address hidden>
Reported-by: kernel test robot <email address hidden>
Reviewed-by: Scott Benesh <email address hidden>
Reviewed-by: Scott Teel <email address hidden>
Reviewed-by: Mike McGowen <email address hidden>
Reviewed-by: Kevin Barnett <email address hidden>
Signed-off-by: Don Brace <email address hidden>
Signed-off-by: Martin K. Petersen <email address hidden>
(cherry picked from commit 667298ceaf042e28b856478e02cfa2cbe8ed83c6)
Signed-off-by: Krzysztof Kozlowski <email address hidden>
Correct system hangs when resuming from hibernation after first successful
hibernation/resume cycle. Rare condition involving OFA.
Note: Suspend/resume is not supported on many platforms. It was originally
intended for workstations.
Link: https://lore.kernel.org/r/161549386295.25025.14555840632114761610.stgit@brunhilda
Reviewed-by: Scott Benesh <email address hidden>
Reviewed-by: Scott Teel <email address hidden>
Signed-off-by: Kevin Barnett <email address hidden>
Signed-off-by: Don Brace <email address hidden>
Signed-off-by: Martin K. Petersen <email address hidden>
(cherry picked from commit 43e97ef482eea96698af5cde99c9d55bbefe225d)
Signed-off-by: Krzysztof Kozlowski <email address hidden>
Update enclosure identifier field corresponding to physical devices in
lsscsi/sysfs.
During device add the SCSI devtype is filled in during slave_configure().
However, when pqi_scsi_update_device() runs (REGNEWD) the firmware returns
zero for the SCSI devtype field, and valid devtype is overwritten by
zero. Due to this, lsscsi output shows wrong values.
Link: https://lore.kernel.org/r/161549385708.25025.17234953506918043750.stgit@brunhilda
Reviewed-by: Scott Benesh <email address hidden>
Reviewed-by: Mike McGowen <email address hidden>
Reviewed-by: Scott Teel <email address hidden>
Reviewed-by: Kevin Barnett <email address hidden>
Signed-off-by: Murthy Bhat <email address hidden>
Signed-off-by: Don Brace <email address hidden>
Signed-off-by: Martin K. Petersen <email address hidden>
(cherry picked from commit d0cba99fd7a3781a78f751cfd4f4e3ff4d0b1ea3)
Signed-off-by: Krzysztof Kozlowski <email address hidden>
5711a12...
by
Kevin Barnett <email address hidden>
scsi: smartpqi: Add additional logging for LUN resets
The entire Linux kernel has been slowly migrating from snprintf() to
scnprintf(), so we are doing our part. This article explains the rationale
for this change:
https: //lwn.net/Articles/69419/
Link: https://lore.kernel.org/r/161549383357.25025.12363435617789964291.stgit@brunhilda
Reviewed-by: Scott Benesh <email address hidden>
Reviewed-by: Mike McGowen <email address hidden>
Reviewed-by: Scott Teel <email address hidden>
Reviewed-by: Martin Wilck <email address hidden>
Signed-off-by: Kevin Barnett <email address hidden>
Signed-off-by: Don Brace <email address hidden>
Signed-off-by: Martin K. Petersen <email address hidden>
(cherry picked from commit a425625277a10dcb039ac05b90202d4f54f824ad)
Signed-off-by: Krzysztof Kozlowski <email address hidden>