All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] smartpqi fix static checker issues
@ 2021-04-15 16:41 Don Brace
  2021-04-15 16:42 ` [PATCH 1/2] smartpqi: fix blocks_per_row static checker issue Don Brace
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Don Brace @ 2021-04-15 16:41 UTC (permalink / raw)
  To: Kevin.Barnett, scott.teel, Justin.Lindley, scott.benesh,
	gerry.morong, mahesh.rajashekhara, mike.mcgowen, murthy.bhat,
	hch, jejb, joseph.szczypek, POSWALD
  Cc: linux-scsi

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@oracle.com>

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@lists.01.org/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@oracle.com>
Reported-by: kernel test robot <lkp@intel.com>

---

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-04-20  2:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-15 16:41 [PATCH 0/2] smartpqi fix static checker issues Don Brace
2021-04-15 16:42 ` [PATCH 1/2] smartpqi: fix blocks_per_row static checker issue Don Brace
2021-04-15 16:42 ` [PATCH 2/2] smartpqi: fix device pointer variable reference " Don Brace
2021-04-16  2:03 ` [PATCH 0/2] smartpqi fix static checker issues Martin K. Petersen
2021-04-20  2:29 ` Martin K. Petersen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.