Pārlūkot izejas kodu

Bluetooth: Fix event sending with DISCOVERY_STOPPED state

We are not supposed to send mgmt_discovering events if we are transiting
from DISCOVERY_STARTING to DISCOVERY_STOPPED state. It doesn't make
sense to send mgmt_discovering event once discovery procedure has not
been even started.

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 13 gadi atpakaļ
vecāks
revīzija
7b99b659d9
1 mainītis faili ar 2 papildinājumiem un 1 dzēšanām
  1. 2 1
      net/bluetooth/hci_core.c

+ 2 - 1
net/bluetooth/hci_core.c

@@ -380,7 +380,8 @@ void hci_discovery_set_state(struct hci_dev *hdev, int state)
 
 
 	switch (state) {
 	switch (state) {
 	case DISCOVERY_STOPPED:
 	case DISCOVERY_STOPPED:
-		mgmt_discovering(hdev, 0);
+		if (hdev->discovery.state != DISCOVERY_STARTING)
+			mgmt_discovering(hdev, 0);
 		break;
 		break;
 	case DISCOVERY_STARTING:
 	case DISCOVERY_STARTING:
 		break;
 		break;