[PATCH] 6lowpan: Add missing locking

From: Pavel Machek
Date: Sun Sep 20 2020 - 05:08:38 EST


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

Signed-off-by: Pavel Machek (CIP) <pavel@xxxxxxx>


diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c
index cff4944d5b66..1420734394e9 100644
--- a/net/bluetooth/6lowpan.c
+++ b/net/bluetooth/6lowpan.c
@@ -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();


--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

Attachment: signature.asc
Description: Digital signature