diff options
author | Andre Guedes <andre.guedes@openbossa.org> | 2012-02-13 19:41:02 +0100 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2012-02-15 14:23:36 +0100 |
commit | 7b99b659d90c5d421cb1867295c78a4c0c030734 (patch) | |
tree | 44533b3e9e43b4582d1ca3424e89dec1c7f8bf3c | |
parent | Bluetooth: Fix discovery state machine (diff) | |
download | linux-7b99b659d90c5d421cb1867295c78a4c0c030734.tar.xz linux-7b99b659d90c5d421cb1867295c78a4c0c030734.zip |
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>
-rw-r--r-- | net/bluetooth/hci_core.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index 9ada16449aed..dc31e7d6028e 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -380,7 +380,8 @@ void hci_discovery_set_state(struct hci_dev *hdev, int state) switch (state) { case DISCOVERY_STOPPED: - mgmt_discovering(hdev, 0); + if (hdev->discovery.state != DISCOVERY_STARTING) + mgmt_discovering(hdev, 0); break; case DISCOVERY_STARTING: break; |