Skip to contentSkip to conversation

6lowpan: Add missing locking

PATCH New Pavel Machek 1 participant 1 message Sep 20, 2020 Bluetooth

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 6lowpan: Add missing locking

I believe set_lock should be taken in exit function, too.

net/bluetooth/6lowpan.c +2 -0
index cff4944d5b66..1420734394e9 100644
@@ -1301,10 +1301,12 @@ static void __exit bt_6lowpan_exit(void)
 	debugfs_remove(lowpan_enable_debugfs);
 	debugfs_remove(lowpan_control_debugfs);
 
+	mutex_lock(&set_lock);
 	if (listen_chan) {
 		l2cap_chan_close(listen_chan, 0);
 		l2cap_chan_put(listen_chan);
 	}
+	mutex_unlock(&set_lock);
 
 	disconnect_devices();
 
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html