Skip to contentSkip to conversation

ntb: transport: Fix uninitialized mutex

PATCH New Dave Jiang 1 participant 1 message Jan 8 NTB driver core

lore
Share & tools
lore

Dave Jiang

author maintainer
#0 lore raw

PATCH 1/1 ntb: transport: Fix uninitialized mutex

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]>
---
 drivers/ntb/ntb_transport.c | 1 +
 1 file changed, 1 insertion(+)
drivers/ntb/ntb_transport.c +1 -0
index eb875e3db2e3..71d4bb25f7fd 100644
@@ -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);
 

base-commit: 7d0a66e4bb9081d75c82ec4957c50034cb0ea449

Signature · 1 line
2.52.0