scsi: lpfc: Fix crash caused by switch reboot
authorJames Smart <jsmart2021@gmail.com>
Mon, 1 Mar 2021 17:18:16 +0000 (09:18 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 4 Mar 2021 22:37:05 +0000 (17:37 -0500)
commit9628aace0d1f74f81baaa353f38e929fb4580248
tree56ced87beab3ffddb18c304683944c2513906780
parentdebbc1e2b978bbacd629e30d93d8eaba1592c358
scsi: lpfc: Fix crash caused by switch reboot

Driver is causing a crash in __lpfc_sli_release_iocbq_s4() when it
dereferences the els_wq which is NULL.

Validate the pring for the els_wq before dereferencing. Reorg the code to
move the pring assignment closer to where it is actually used.

Link: https://lore.kernel.org/r/20210301171821.3427-18-jsmart2021@gmail.com
Co-developed-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_sli.c