diff options
author | Andre Guedes <andre.guedes@openbossa.org> | 2012-02-13 22:41:01 +0400 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2012-02-15 17:23:27 +0400 |
commit | 203159d486006a18fa1ccf787a10d15d3128cdac (patch) | |
tree | 7879f84c8c9161215664fd98d9b760c0a0efa1c0 /net/bluetooth | |
parent | e70bb2e89959983aebcfce28f645a1104ffa9ab2 (diff) | |
download | linux-203159d486006a18fa1ccf787a10d15d3128cdac.tar.xz |
Bluetooth: Fix discovery state machine
In case of Start Discovery command failure, we should set the discovery
state to DISCOVERY_STOPPED. Otherwise, we stuck at DISCOVERY_STARTING
state and subsequent Start Discovery commands will simply fail.
Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth')
-rw-r--r-- | net/bluetooth/mgmt.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 8efbd8eaa1b3..066d338be1ce 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -3096,6 +3096,8 @@ int mgmt_start_discovery_failed(struct hci_dev *hdev, u8 status) struct pending_cmd *cmd; int err; + hci_discovery_set_state(hdev, DISCOVERY_STOPPED); + cmd = mgmt_pending_find(MGMT_OP_START_DISCOVERY, hdev); if (!cmd) return -ENOENT; |