aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndre Guedes <andre.guedes@openbossa.org>2011-09-09 17:56:24 -0400
committerGustavo F. Padovan <padovan@profusion.mobi>2011-09-21 11:59:16 -0400
commita8f13c8cd2c732828e5da735c204447a55cdab03 (patch)
treebbb5da005171f047c84033d078d7e50233578a97
parent51beabdf624df14d0805b001d3f939629b70d9db (diff)
Bluetooth: Reduce critical region.
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>
-rw-r--r--net/bluetooth/hci_event.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index fd6eea0941b..35083f2aa2e 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -898,16 +898,15 @@ static void hci_cc_le_set_scan_enable(struct hci_dev *hdev,
898 if (!cp) 898 if (!cp)
899 return; 899 return;
900 900
901 hci_dev_lock(hdev);
902
903 if (cp->enable == 0x01) { 901 if (cp->enable == 0x01) {
904 del_timer(&hdev->adv_timer); 902 del_timer(&hdev->adv_timer);
903
904 hci_dev_lock(hdev);
905 hci_adv_entries_clear(hdev); 905 hci_adv_entries_clear(hdev);
906 hci_dev_unlock(hdev);
906 } else if (cp->enable == 0x00) { 907 } else if (cp->enable == 0x00) {
907 mod_timer(&hdev->adv_timer, jiffies + ADV_CLEAR_TIMEOUT); 908 mod_timer(&hdev->adv_timer, jiffies + ADV_CLEAR_TIMEOUT);
908 } 909 }
909
910 hci_dev_unlock(hdev);
911} 910}
912 911
913static void hci_cc_le_ltk_reply(struct hci_dev *hdev, struct sk_buff *skb) 912static void hci_cc_le_ltk_reply(struct hci_dev *hdev, struct sk_buff *skb)