[PATCH 0/2] smartpqi fix static checker issues

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

This set corrects two static checker warnings found by
Dan Carpenter <dan.carpenter@xxxxxxxxxx>

smartpqi-fix-blocks_per_row-static-checker-issue
 Link: https://lore.kernel.org/linux-scsi/YG%2F5kWHHAr7w5dU5@mwanda/
 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/kbuild@xxxxxxxxxxxx/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.

Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Reported-by: kernel test robot <lkp@xxxxxxxxx>

---

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



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux