* [PATCH] Bluetooth: Check status of command complete for HCI_Reset
@ 2014-11-02 1:45 Marcel Holtmann
2014-11-02 7:59 ` Johan Hedberg
0 siblings, 1 reply; 2+ messages in thread
From: Marcel Holtmann @ 2014-11-02 1:45 UTC (permalink / raw)
To: linux-bluetooth
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>
---
net/bluetooth/hci_event.c | 3 +++
1 file changed, 3 insertions(+)
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;
--
1.9.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Bluetooth: Check status of command complete for HCI_Reset
2014-11-02 1:45 [PATCH] Bluetooth: Check status of command complete for HCI_Reset Marcel Holtmann
@ 2014-11-02 7:59 ` Johan Hedberg
0 siblings, 0 replies; 2+ messages in thread
From: Johan Hedberg @ 2014-11-02 7:59 UTC (permalink / raw)
To: Marcel Holtmann; +Cc: linux-bluetooth
Hi Marcel,
On Sun, Nov 02, 2014, Marcel Holtmann wrote:
> 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>
> ---
> net/bluetooth/hci_event.c | 3 +++
> 1 file changed, 3 insertions(+)
Applied to bluetooth-next. Thanks.
Johan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-11-02 7:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-02 1:45 [PATCH] Bluetooth: Check status of command complete for HCI_Reset Marcel Holtmann
2014-11-02 7:59 ` Johan Hedberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox