From: Marcel Holtmann Date: Sun, 2 Nov 2014 01:45:58 +0000 (+0100) Subject: Bluetooth: Check status of command complete for HCI_Reset X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=8761f9d6620b0be6b08f21807568fbbfcbb128d2;p=openwrt%2Fstaging%2Fblogic.git Bluetooth: Check status of command complete for HCI_Reset 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 Signed-off-by: Johan Hedberg --- diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index aa152140c3e2..3dd2550b4c07 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c @@ -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;