Bluetooth: Check status of command complete for HCI_Reset
authorMarcel Holtmann <marcel@holtmann.org>
Sun, 2 Nov 2014 01:45:58 +0000 (02:45 +0100)
committerJohan Hedberg <johan.hedberg@intel.com>
Sun, 2 Nov 2014 07:58:50 +0000 (09:58 +0200)
When the HCI_Reset command returns, the status needs to be checked. It
is unlikely that HCI_Reset actually fails, but when it fails, it is a
bad idea to reset all values since the controller will have not reset
its values in that case.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
net/bluetooth/hci_event.c

index aa152140c3e279bd6599b5b09498f748e501c08e..3dd2550b4c0752a44f17f805897e1bf1c50473cd 100644 (file)
@@ -189,6 +189,9 @@ static void hci_cc_reset(struct hci_dev *hdev, struct sk_buff *skb)
 
        clear_bit(HCI_RESET, &hdev->flags);
 
+       if (status)
+               return;
+
        /* Reset all non-persistent flags */
        hdev->dev_flags &= ~HCI_PERSISTENT_MASK;