diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2014-06-10 11:05:57 (GMT) |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-06-13 11:32:16 (GMT) |
commit | 50143a433b70e3145bcf8a4a4e54f0c11bdee32b (patch) | |
tree | 312d2eb6ebf5f7b30a893ef20101175cdc3df2c3 | |
parent | fff3490f47810e2d34b91fb9e31103e923b11c2f (diff) | |
download | linux-50143a433b70e3145bcf8a4a4e54f0c11bdee32b.tar.xz |
Bluetooth: Fix indicating discovery state when canceling inquiry
When inquiry is canceled through the HCI_Cancel_Inquiry command there is
no Inquiry Complete event generated. Instead, all we get is the command
complete for the HCI_Inquiry_Cancel command. This means that we must
call the hci_discovery_set_state() function from the respective command
complete handler in order to ensure that user space knows the correct
discovery state.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Cc: stable@vger.kernel.org
-rw-r--r-- | net/bluetooth/hci_event.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 3183edc..640c54e 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c @@ -48,6 +48,10 @@ static void hci_cc_inquiry_cancel(struct hci_dev *hdev, struct sk_buff *skb) smp_mb__after_atomic(); /* wake_up_bit advises about this barrier */ wake_up_bit(&hdev->flags, HCI_INQUIRY); + hci_dev_lock(hdev); + hci_discovery_set_state(hdev, DISCOVERY_STOPPED); + hci_dev_unlock(hdev); + hci_conn_check_pending(hdev); } |