From: Johan Hedberg Date: Mon, 14 Oct 2013 13:20:07 +0000 (+0300) Subject: Bluetooth: Fix updating advertising data needlessly X-Git-Tag: v3.13-rc1~105^2~23^2^2~61^2~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c6d887aaf8f772fbe07604390975921ad3350a58;p=profile%2Fcommon%2Fkernel-common.git 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 Signed-off-by: Marcel Holtmann --- 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);