diff
 	hci_unregister_suspend_notifier(hdev);
+
+	hci_dev_lock(hdev);
+	mgmt_index_removed(hdev);
+	hci_dev_unlock(hdev);
+
+	if (hdev->rfkill) {
+		rfkill_unregister(hdev->rfkill);
+		hdev->rfkill = NULL;
+	}
 
 	msft_unregister(hdev);
 
 	hci_dev_do_close(hdev);
-
-	if (!test_bit(HCI_INIT, &hdev->flags) &&
-	    !hci_dev_test_flag(hdev, HCI_SETUP) &&
-	    !hci_dev_test_flag(hdev, HCI_CONFIG)) {
-		hci_dev_lock(hdev);
-		mgmt_index_removed(hdev);
-		hci_dev_unlock(hdev);
-	}
-
-	BUG_ON(!list_empty(&hdev->mgmt_pending));
-
-	hci_sock_dev_event(hdev, HCI_DEV_UNREG);
-
-	if (hdev->rfkill) {
-		rfkill_unregister(hdev->rfkill);
