scsi: lpfc: Fix BFS crash with DIX enabled
authorJames Smart <jsmart2021@gmail.com>
Wed, 22 May 2019 00:49:09 +0000 (17:49 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 18 Jun 2019 23:46:22 +0000 (19:46 -0400)
commitaa6ff309187256ee542a8cf47adbfcfdaa888c46
tree542ca60b8f80816ed99a3d05c4aec5a2b07b3713
parent93f647f93df14742923133582ad603bf35628e92
scsi: lpfc: Fix BFS crash with DIX enabled

Crashes in scsi_queue_rq or in dma_unmap_direct_sg during BFS when lpfc has
lpfc_enable_bg=1.

lpfc is setting DIX and prot sg after scsi_add_host_with_dma() has been
called. The scsi_host_set_prot() and scsi_host_set_guard() routines need to
be called before scsi_add_host_with_dma().

Revise the calling sequence to set the protection/guard data before calling
scsi_add_host_with_dma().

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
Reviewed-by: Ewan D. Milne <emilne@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_init.c