Skip to content

smartpqi fix static checker issues

Don Brace linux-scsi 1 version Applied

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

Get series with b4
b4 am 161850488487.7302.7018870513204678832.stgit@brunhilda

Versions newest first

  1. v1 Latest2 patches 2 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/2smartpqi: fix blocks_per_row static checker issuedrivers/scsi/smartpqi/smartpqi_init.c+6 -20 replies
2/2smartpqi: fix device pointer variable reference static checker issuedrivers/scsi/smartpqi/smartpqi_sas_transport.c+1 -10 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchScott BeneshScott TeelMike McGowenKevin Barnett
1/2R-b R-b R-b R-b
2/2R-b R-b R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v1 thread

Cover letter [PATCH 0/2] smartpqi fix static checker issues

These patches are based on Martin Peterson's 5.13/scsi-queue tree

This set corrects two static checker warnings found by Dan Carpenter <[email protected]>

smartpqi-fix-blocks_per_row-static-checker-issue

Fixes 6702d2c40f31 ("scsi: smartpqi: Add support for RAID5 and RAID6 writes")

Using rmd->blocks_per_row as a divisor without checking it for 0 first.
The variable blocks_per_row is used as a divisor in many raid_map calculations. This can lead to a divide by 0. This patch prevents a possible divide by 0. If the member is 0, return PQI_RAID_BYPASS_INELIGIBLE before any division is performed. The current check for a non-0 value was after multiple divisions were performed.

smartpqi-fix-device-pointer-variable-reference

Link ("https://www.mail-archive.com/[email protected]/msg06329.html")
Fixes ec504b23df9d ("[304/324] scsi: smartpqi: Add phy ID support for the physical drives")

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)
In function pqi_sas_port_add_rphy there is a pointer dereference without a check for NULL value. Correct this by moving the pointer dereference after the check for non-NULL value.

Note: I could not find the e-mail for
smartpqi-fix-device-pointer-variable-reference issue in lore.kernel.org so I used mail-archive.com.
It may have not been forwarded to lore.kernel.org. Not sure.

---

Don Brace (2):
smartpqi: fix blocks_per_row static checker issue
smartpqi: fix device pointer variable reference static checker issue

 drivers/scsi/smartpqi/smartpqi_sas_transport.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
Signature