Skip to content

Commit

Permalink
Bluetooth: Reduce critical region.
Browse files Browse the repository at this point in the history
This patch reduces the critial region (protected by hdev->lock) in
hci_cc_le_set_scan_enable(). This way, only really required code is
synchronized.

Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
  • Loading branch information
Andre Guedes authored and Gustavo F. Padovan committed Sep 21, 2011
1 parent 51beabd commit a8f13c8
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions net/bluetooth/hci_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -898,16 +898,15 @@ static void hci_cc_le_set_scan_enable(struct hci_dev *hdev,
if (!cp)
return;

hci_dev_lock(hdev);

if (cp->enable == 0x01) {
del_timer(&hdev->adv_timer);

hci_dev_lock(hdev);
hci_adv_entries_clear(hdev);
hci_dev_unlock(hdev);
} else if (cp->enable == 0x00) {
mod_timer(&hdev->adv_timer, jiffies + ADV_CLEAR_TIMEOUT);
}

hci_dev_unlock(hdev);
}

static void hci_cc_le_ltk_reply(struct hci_dev *hdev, struct sk_buff *skb)
Expand Down

0 comments on commit a8f13c8

Please sign in to comment.