From: Andre Guedes Date: Fri, 9 Sep 2011 21:56:24 +0000 (-0300) Subject: Bluetooth: Reduce critical region. X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=a8f13c8cd2c732828e5da735c204447a55cdab03;p=mv-sheeva.git 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 Signed-off-by: Gustavo F. Padovan --- 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, 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)