summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--net/bluetooth/hci_core.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 79693a9ef4eb..5d4ac3fbbc08 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1640,6 +1640,8 @@ static int hci_dev_do_close(struct hci_dev *hdev)
hci_conn_hash_flush(hdev);
hci_dev_unlock(hdev);
+ smp_unregister(hdev);
+
hci_notify(hdev, HCI_DEV_DOWN);
if (hdev->flush)
@@ -2147,8 +2149,6 @@ static void hci_power_off(struct work_struct *work)
BT_DBG("%s", hdev->name);
hci_dev_do_close(hdev);
-
- smp_unregister(hdev);
}
static void hci_error_reset(struct work_struct *work)
@@ -2166,8 +2166,6 @@ static void hci_error_reset(struct work_struct *work)
if (hci_dev_do_close(hdev))
return;
- smp_unregister(hdev);
-
hci_dev_do_open(hdev);
}
@@ -3137,8 +3135,6 @@ void hci_unregister_dev(struct hci_dev *hdev)
rfkill_destroy(hdev->rfkill);
}
- smp_unregister(hdev);
-
device_del(&hdev->dev);
debugfs_remove_recursive(hdev->debugfs);