aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/rfcomm/tty.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/bluetooth/rfcomm/tty.c')
-rw-r--r--net/bluetooth/rfcomm/tty.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c
index bb570d95adca..6ea08b05b53a 100644
--- a/net/bluetooth/rfcomm/tty.c
+++ b/net/bluetooth/rfcomm/tty.c
@@ -84,10 +84,6 @@ static void rfcomm_dev_destruct(struct tty_port *port)
84 84
85 BT_DBG("dev %p dlc %p", dev, dlc); 85 BT_DBG("dev %p dlc %p", dev, dlc);
86 86
87 spin_lock(&rfcomm_dev_lock);
88 list_del(&dev->list);
89 spin_unlock(&rfcomm_dev_lock);
90
91 rfcomm_dlc_lock(dlc); 87 rfcomm_dlc_lock(dlc);
92 /* Detach DLC if it's owned by this dev */ 88 /* Detach DLC if it's owned by this dev */
93 if (dlc->owner == dev) 89 if (dlc->owner == dev)
@@ -98,6 +94,10 @@ static void rfcomm_dev_destruct(struct tty_port *port)
98 94
99 tty_unregister_device(rfcomm_tty_driver, dev->id); 95 tty_unregister_device(rfcomm_tty_driver, dev->id);
100 96
97 spin_lock(&rfcomm_dev_lock);
98 list_del(&dev->list);
99 spin_unlock(&rfcomm_dev_lock);
100
101 kfree(dev); 101 kfree(dev);
102 102
103 /* It's safe to call module_put() here because socket still 103 /* It's safe to call module_put() here because socket still