[PATCH] scsi: elx: libefc: Initialize the virtual port list lock
From: Shuo Qin
Date: Sat Dec 05 2026 - 04:55:00 EST
The virtual port helpers protect efc->vport_list with vport_lock, but
efcport_init() initializes only the list head. The dynamically allocated
efc object therefore contains an uninitialized spinlock. Taking it during
virtual port teardown can trigger a spinlock debugging failure.
Initialize vport_lock alongside the list before any virtual port helper
can use it.
Fixes: fcd427303eb9 ("scsi: elx: libefc: SLI and FC PORT state machine interfaces")
Cc: stable@xxxxxxxxxxxxxxx
Co-developed-by: Bin Yu <byu@xxxxxxxxxxxxx>
Signed-off-by: Bin Yu <byu@xxxxxxxxxxxxx>
Co-developed-by: Cheng Wen <wencheng@xxxxxxxxxxxxx>
Signed-off-by: Cheng Wen <wencheng@xxxxxxxxxxxxx>
Signed-off-by: Shuo Qin <23159100078@xxxxxxxxxxxxxxxxx>
---
drivers/scsi/elx/libefc/efclib.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/scsi/elx/libefc/efclib.c b/drivers/scsi/elx/libefc/efclib.c
index ceec0e2a0266adb3b3474e080cf0f263a744c28d..94a0022b55ea6eea9b4a8baa7fe98bae595d62da 100644
--- a/drivers/scsi/elx/libefc/efclib.c
+++ b/drivers/scsi/elx/libefc/efclib.c
@@ -26,6 +26,7 @@ int efcport_init(struct efc *efc)
spin_lock_init(&efc->lock);
INIT_LIST_HEAD(&efc->vport_list);
+ spin_lock_init(&efc->vport_lock);
efc->hold_frames = false;
spin_lock_init(&efc->pend_frames_lock);
INIT_LIST_HEAD(&efc->pend_frames);
--
2.34.1