projects/linux·commit 2ccb5e8d

ntb: transport: Fix uninitialized mutex

2ccb5e8d · Dave Jiang <[email protected]> · 2026-01-08 14:09:33 -07:00

When the mutex 'link_event_lock' was introduced, it was never
initialized and it triggers kernel warnings when used with locking
debug turned on. Add initialization for the mutex.

Fixes: 3db835dd8f9a ("ntb: Add mutex to make link_event_callback executed linearly.")
Cc: fuyuanli <[email protected]>
Signed-off-by: Dave Jiang <[email protected]>
Signed-off-by: Jon Mason <[email protected]>
Commit
2ccb5e8dbcd2dedf13e0270165ac48bd79b7f673
Parents
8f0b4cce

Changes

1 files changed · +1 −0

FileStatusAddDelContent
drivers/ntb/ntb_transport.cmodified+1−0View file

drivers/ntb/ntb_transport.c

View file
diff --git a/drivers/ntb/ntb_transport.c b/drivers/ntb/ntb_transport.c
index eb875e3..71d4bb2 100644
--- a/drivers/ntb/ntb_transport.c
+++ b/drivers/ntb/ntb_transport.c
@@ -1394,6 +1394,7 @@ static int ntb_transport_probe(struct ntb_client *self, struct ntb_dev *ndev)
goto err2;
}
+ mutex_init(&nt->link_event_lock);
INIT_DELAYED_WORK(&nt->link_work, ntb_transport_link_work);
INIT_WORK(&nt->link_cleanup, ntb_transport_link_cleanup_work);