summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_core.c
diff options
context:
space:
mode:
authorJohan Hedberg2014-11-19 12:16:41 +0100
committerMarcel Holtmann2014-11-19 16:15:55 +0100
commit22a3ceabf152c7c88afa9e34ea33fc3fa55e6cf8 (patch)
treef7098bf77814145b9a9b57a9913c76a91ca4d15e /net/bluetooth/hci_core.c
parentBluetooth: Add support for Broadcom BCM20702A1 variant (diff)
downloadkernel-qcow2-linux-22a3ceabf152c7c88afa9e34ea33fc3fa55e6cf8.tar.gz
kernel-qcow2-linux-22a3ceabf152c7c88afa9e34ea33fc3fa55e6cf8.tar.xz
kernel-qcow2-linux-22a3ceabf152c7c88afa9e34ea33fc3fa55e6cf8.zip
Bluetooth: Fix setting state back to TASK_RUNNING
In __hci_cmd_sync_ev() and __hci_req_sync() if the hci_req_run() call fails and we return from the functions we should ensure that the state doesn't remain in TASK_INTERRUPTIBLE that we just set it to. This patch fixes missing calls to set_current_state(TASK_RUNNING) in both places. Reported-by: Kirill A. Shutemov <kirill@shutemov.name> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Tested-by: Kirill A. Shutemov <kirill@shutemov.name> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/hci_core.c')
-rw-r--r--net/bluetooth/hci_core.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index d786958a1dec..a67a4b8e4e1c 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1128,6 +1128,7 @@ struct sk_buff *__hci_cmd_sync_ev(struct hci_dev *hdev, u16 opcode, u32 plen,
err = hci_req_run(&req, hci_req_sync_complete);
if (err < 0) {
remove_wait_queue(&hdev->req_wait_q, &wait);
+ set_current_state(TASK_RUNNING);
return ERR_PTR(err);
}
@@ -1196,6 +1197,7 @@ static int __hci_req_sync(struct hci_dev *hdev,
hdev->req_status = 0;
remove_wait_queue(&hdev->req_wait_q, &wait);
+ set_current_state(TASK_RUNNING);
/* ENODATA means the HCI request command queue is empty.
* This can happen when a request with conditionals doesn't