Parcourir la source

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>
Andre Guedes il y a 13 ans
Parent
commit
203159d486
1 fichiers modifiés avec 2 ajouts et 0 suppressions
  1. 2 0
      net/bluetooth/mgmt.c

+ 2 - 0
net/bluetooth/mgmt.c

@@ -3096,6 +3096,8 @@ int mgmt_start_discovery_failed(struct hci_dev *hdev, u8 status)
 	struct pending_cmd *cmd;
 	struct pending_cmd *cmd;
 	int err;
 	int err;
 
 
+	hci_discovery_set_state(hdev, DISCOVERY_STOPPED);
+
 	cmd = mgmt_pending_find(MGMT_OP_START_DISCOVERY, hdev);
 	cmd = mgmt_pending_find(MGMT_OP_START_DISCOVERY, hdev);
 	if (!cmd)
 	if (!cmd)
 		return -ENOENT;
 		return -ENOENT;