scsi: lpfc: Validate hdwq pointers before dereferencing in reset/errata paths
authorJustin Tee <justin.tee@broadcom.com>
Fri, 26 Jul 2024 23:15:07 +0000 (16:15 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Sat, 3 Aug 2024 01:48:05 +0000 (21:48 -0400)
commit2be1d4f11944cd6283cb97268b3e17c4424945ca
tree76623bfcbbd6a877d3b6a7f06089be56dce401b4
parentf1bfe32073964372c1dfa572480eb43d44e34909
scsi: lpfc: Validate hdwq pointers before dereferencing in reset/errata paths

When the HBA is undergoing a reset or is handling an errata event, NULL ptr
dereference crashes may occur in routines such as
lpfc_sli_flush_io_rings(), lpfc_dev_loss_tmo_callbk(), or
lpfc_abort_handler().

Add NULL ptr checks before dereferencing hdwq pointers that may have been
freed due to operations colliding with a reset or errata event handler.

Signed-off-by: Justin Tee <justin.tee@broadcom.com>
Link: https://lore.kernel.org/r/20240726231512.92867-4-justintee8345@gmail.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_hbadisc.c
drivers/scsi/lpfc/lpfc_scsi.c
drivers/scsi/lpfc/lpfc_sli.c