All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: elx: libefc: Initialize the virtual port list lock
@ 2026-12-05  9:54 Shuo Qin
  2026-12-05 10:05 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Shuo Qin @ 2026-12-05  9:54 UTC (permalink / raw)
  To: Ram Vegesna
  Cc: James E.J. Bottomley, Martin K. Petersen, linux-scsi,
	target-devel, stable, linux-kernel, Bin Yu, Cheng Wen,
	XinCheng Wang

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@vger.kernel.org
Co-developed-by: Bin Yu <byu@xidian.edu.cn>
Signed-off-by: Bin Yu <byu@xidian.edu.cn>
Co-developed-by: Cheng Wen <wencheng@xidian.edu.cn>
Signed-off-by: Cheng Wen <wencheng@xidian.edu.cn>
Signed-off-by: Shuo Qin <23159100078@stu.xidian.edu.cn>
---
 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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-12-05 10:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-05  9:54 [PATCH] scsi: elx: libefc: Initialize the virtual port list lock Shuo Qin
2026-12-05 10:05 ` sashiko-bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.