From 40ff33bcc88dc6624b00e42c21d91c47cb0cc8b0 Mon Sep 17 00:00:00 2001 From: Andre Guedes Date: Fri, 8 Mar 2013 11:20:13 -0300 Subject: [PATCH] --- yaml --- r: 369011 b: refs/heads/master c: bc4445c72cb5d1ed5af80c73e60214ab5ebd8e55 h: refs/heads/master i: 369009: b16e3cb6ef1aa6b61a5ab521b81cfc71b3a8e0ab 369007: 378f9b72a6244c6425c37b542720eedfcdfb8537 v: v3 --- [refs] | 2 +- trunk/net/bluetooth/hci_core.c | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 23697853eed4..f09e9c4f70f4 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d865b0070485dfbb0611c5dc07fff21c440858a5 +refs/heads/master: bc4445c72cb5d1ed5af80c73e60214ab5ebd8e55 diff --git a/trunk/net/bluetooth/hci_core.c b/trunk/net/bluetooth/hci_core.c index 3fc699db8fb5..5c6439847286 100644 --- a/trunk/net/bluetooth/hci_core.c +++ b/trunk/net/bluetooth/hci_core.c @@ -95,15 +95,11 @@ static int __hci_req_sync(struct hci_dev *hdev, hdev->req_status = HCI_REQ_PEND; - add_wait_queue(&hdev->req_wait_q, &wait); - set_current_state(TASK_INTERRUPTIBLE); - func(&req, opt); err = hci_req_run(&req, hci_req_sync_complete); if (err < 0) { hdev->req_status = 0; - remove_wait_queue(&hdev->req_wait_q, &wait); /* req_run will fail if the request did not add any * commands to the queue, something that can happen when * a request with conditionals doesn't trigger any @@ -113,6 +109,9 @@ static int __hci_req_sync(struct hci_dev *hdev, return 0; } + add_wait_queue(&hdev->req_wait_q, &wait); + set_current_state(TASK_INTERRUPTIBLE); + schedule_timeout(timeout); remove_wait_queue(&hdev->req_wait_q, &wait);