hci_disconn_cfm(conn, ev->reason);
 
-       /* The suspend notifier is waiting for all devices to disconnect so
-        * clear the bit from pending tasks and inform the wait queue.
-        */
-       if (list_empty(&hdev->conn_hash.list) &&
-           test_and_clear_bit(SUSPEND_DISCONNECTING, hdev->suspend_tasks)) {
-               wake_up(&hdev->suspend_wait_q);
-       }
-
        /* Re-enable advertising if necessary, since it might
         * have been disabled by the connection. From the
         * HCI_LE_Set_Advertise_Enable command description in
 
        hci_conn_del(conn);
 
+       /* The suspend notifier is waiting for all devices to disconnect so
+        * clear the bit from pending tasks and inform the wait queue.
+        */
+       if (list_empty(&hdev->conn_hash.list) &&
+           test_and_clear_bit(SUSPEND_DISCONNECTING, hdev->suspend_tasks)) {
+               wake_up(&hdev->suspend_wait_q);
+       }
+
 unlock:
        hci_dev_unlock(hdev);
 }