summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_vmid.c
diff options
context:
space:
mode:
authorJustin Tee <justin.tee@broadcom.com>2024-07-27 01:15:08 +0200
committerMartin K. Petersen <martin.petersen@oracle.com>2024-08-03 03:48:05 +0200
commit3976beb1b410441bab9c3726e2ba76cc7a4c0b2d (patch)
tree8b5ff792f4809aa0e5592f2c8cdf25fe0fea5a20 /drivers/scsi/lpfc/lpfc_vmid.c
parentscsi: lpfc: Validate hdwq pointers before dereferencing in reset/errata paths (diff)
downloadlinux-3976beb1b410441bab9c3726e2ba76cc7a4c0b2d.tar.xz
linux-3976beb1b410441bab9c3726e2ba76cc7a4c0b2d.zip
scsi: lpfc: Fix unintentional double clearing of vmid_flag
The vport->vmid_flag is unintentionally cleared twice after an issue_lip via the lpfc_reinit_vmid routine(). The first call to lpfc_reinit_vmid() is in lpfc_cmpl_els_flogi(). Then lpfc_cmpl_els_flogi_fabric() calls lpfc_register_new_vport(), which calls lpfc_cmpl_reg_new_vport() when the mbox command completes and calls lpfc_reinit_vmid() a second time. Fix by moving the vmid_flag clear outside of the lpfc_reinit_vmid() routine so that vmid_flag is only cleared once upon FLOGI completion. Signed-off-by: Justin Tee <justin.tee@broadcom.com> Link: https://lore.kernel.org/r/20240726231512.92867-5-justintee8345@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to '')
-rw-r--r--drivers/scsi/lpfc/lpfc_vmid.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/drivers/scsi/lpfc/lpfc_vmid.c b/drivers/scsi/lpfc/lpfc_vmid.c
index 773e02ae20c3..cf8ba840d0ea 100644
--- a/drivers/scsi/lpfc/lpfc_vmid.c
+++ b/drivers/scsi/lpfc/lpfc_vmid.c
@@ -321,6 +321,5 @@ lpfc_reinit_vmid(struct lpfc_vport *vport)
if (!hash_empty(vport->hash_table))
hash_for_each_safe(vport->hash_table, bucket, tmp, cur, hnode)
hash_del(&cur->hnode);
- vport->vmid_flag = 0;
write_unlock(&vport->vmid_lock);
}