scsi: lpfc: Synchronize access to remoteport via rport
authorJames Smart <jsmart2021@gmail.com>
Thu, 13 Sep 2018 22:41:10 +0000 (15:41 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 21 Sep 2018 02:02:36 +0000 (22:02 -0400)
commit9e210178267b80c4eeb832fade7e146a18c84915
treed3dce6607197b83d4d41ac6a2285ce8cbb8c10a4
parentd87161bea405e3260377026ca8a704a3f68bd67a
scsi: lpfc: Synchronize access to remoteport via rport

The driver currently uses the ndlp to get the local rport which is then used
to get the nvme transport remoteport pointer. There can be cases where a stale
remoteport pointer is obtained as synchronization isn't done through the
different dereferences.

Correct by using locks to synchronize the dereferences.

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_attr.c
drivers/scsi/lpfc/lpfc_debugfs.c
drivers/scsi/lpfc/lpfc_nvme.c