Commit f7c95d74 authored by James Smart's avatar James Smart Committed by Martin K. Petersen

scsi: elx: efct: Fix vport list linkage in LIO backend

vport is linked onto the driver's vport list at allocation, but failure
path fails to remove it from the list.

Change location of linkage until after complete vport completion.

Link: https://lore.kernel.org/r/20210619155729.20049-1-jsmart2021@gmail.com
Fixes: 692e5d73 ("scsi: elx: efct: LIO backend interface routines")
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Co-developed-by: default avatarRam Vegesna <ram.vegesna@broadcom.com>
Signed-off-by: default avatarRam Vegesna <ram.vegesna@broadcom.com>
Signed-off-by: default avatarJames Smart <james.smart@broadcom.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent f6060eb1
...@@ -832,10 +832,6 @@ efct_lio_npiv_make_nport(struct target_fabric_configfs *tf, ...@@ -832,10 +832,6 @@ efct_lio_npiv_make_nport(struct target_fabric_configfs *tf,
} }
vport_list->lio_vport = lio_vport; vport_list->lio_vport = lio_vport;
spin_lock_irqsave(&efct->tgt_efct.efct_lio_lock, flags);
INIT_LIST_HEAD(&vport_list->list_entry);
list_add_tail(&vport_list->list_entry, &efct->tgt_efct.vport_list);
spin_unlock_irqrestore(&efct->tgt_efct.efct_lio_lock, flags);
memset(&vport_id, 0, sizeof(vport_id)); memset(&vport_id, 0, sizeof(vport_id));
vport_id.port_name = npiv_wwpn; vport_id.port_name = npiv_wwpn;
...@@ -853,6 +849,10 @@ efct_lio_npiv_make_nport(struct target_fabric_configfs *tf, ...@@ -853,6 +849,10 @@ efct_lio_npiv_make_nport(struct target_fabric_configfs *tf,
} }
lio_vport->fc_vport = new_fc_vport; lio_vport->fc_vport = new_fc_vport;
spin_lock_irqsave(&efct->tgt_efct.efct_lio_lock, flags);
INIT_LIST_HEAD(&vport_list->list_entry);
list_add_tail(&vport_list->list_entry, &efct->tgt_efct.vport_list);
spin_unlock_irqrestore(&efct->tgt_efct.efct_lio_lock, flags);
return &lio_vport->vport_wwn; return &lio_vport->vport_wwn;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment