Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7b99b659 authored by Andre Guedes's avatar Andre Guedes Committed by Johan Hedberg
Browse files

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: default avatarAndre Guedes <andre.guedes@openbossa.org>
Acked-by: default avatarMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
parent 203159d4
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -380,6 +380,7 @@ void hci_discovery_set_state(struct hci_dev *hdev, int state)

	switch (state) {
	case DISCOVERY_STOPPED:
		if (hdev->discovery.state != DISCOVERY_STARTING)
			mgmt_discovering(hdev, 0);
		break;
	case DISCOVERY_STARTING: