summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2013-10-14 13:20:07 (GMT)
committerMarcel Holtmann <marcel@holtmann.org>2013-10-14 13:48:08 (GMT)
commitc6d887aaf8f772fbe07604390975921ad3350a58 (patch)
tree03b7005a0f90c6cc8cd53bb6b470d8ae9a34b15e
parent95c66e75baf34024213a779dac08f95e6b5aa6a4 (diff)
downloadlinux-fsl-qoriq-c6d887aaf8f772fbe07604390975921ad3350a58.tar.xz
Bluetooth: Fix updating advertising data needlessly
We need to ensure that the advertising data is up-to-date whenever advertising is enabled, but when disabling advertising we do not need to worry about it (since it will eventually get fixed as soon as advertising is enabled again). This patch fixes this in the command complete callback for set_adv_enable. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
-rw-r--r--net/bluetooth/hci_event.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index aa6fed3..da2bc3d 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -924,7 +924,7 @@ static void hci_cc_le_set_adv_enable(struct hci_dev *hdev, struct sk_buff *skb)
clear_bit(HCI_ADVERTISING, &hdev->dev_flags);
}
- if (!test_bit(HCI_INIT, &hdev->flags)) {
+ if (*sent && !test_bit(HCI_INIT, &hdev->flags)) {
struct hci_request req;
hci_req_init(&req, hdev);