]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
scsi: lpfc: Fix Oops in nvme_register with target logout/login
authorJames Smart <jsmart2021@gmail.com>
Wed, 14 Aug 2019 23:56:41 +0000 (16:56 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 20 Aug 2019 02:41:09 +0000 (22:41 -0400)
commit61184f1742c901160ceead85b3f1b3d03038f1d0
tree2b16a3885ddb4ecaecf868e1a8b14b88fb084478
parent08180db2542b94e93cbdffd2a42cac2db147114a
scsi: lpfc: Fix Oops in nvme_register with target logout/login

lpfc_nvme_register_port hit a null prev_ndlp pointer in a test with lots of
target ports swapping addresses. The oldport value was stale, thus it's
ndlp (prev_ndlp set to it) was used.

Fix by moving oldrport pointer checks, and if used prev_ndlp pointer
assignment, to be done while the lock is held.

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_nvme.c