diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2014-11-19 06:16:41 -0500 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-11-19 10:15:55 -0500 |
commit | 22a3ceabf152c7c88afa9e34ea33fc3fa55e6cf8 (patch) | |
tree | f7098bf77814145b9a9b57a9913c76a91ca4d15e /net/bluetooth/hci_core.c | |
parent | a86c02ea38c53b695209b1181f9e2e18d73eb4e8 (diff) |
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.c | 2 |
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, | |||
1128 | err = hci_req_run(&req, hci_req_sync_complete); | 1128 | err = hci_req_run(&req, hci_req_sync_complete); |
1129 | if (err < 0) { | 1129 | if (err < 0) { |
1130 | remove_wait_queue(&hdev->req_wait_q, &wait); | 1130 | remove_wait_queue(&hdev->req_wait_q, &wait); |
1131 | set_current_state(TASK_RUNNING); | ||
1131 | return ERR_PTR(err); | 1132 | return ERR_PTR(err); |
1132 | } | 1133 | } |
1133 | 1134 | ||
@@ -1196,6 +1197,7 @@ static int __hci_req_sync(struct hci_dev *hdev, | |||
1196 | hdev->req_status = 0; | 1197 | hdev->req_status = 0; |
1197 | 1198 | ||
1198 | remove_wait_queue(&hdev->req_wait_q, &wait); | 1199 | remove_wait_queue(&hdev->req_wait_q, &wait); |
1200 | set_current_state(TASK_RUNNING); | ||
1199 | 1201 | ||
1200 | /* ENODATA means the HCI request command queue is empty. | 1202 | /* ENODATA means the HCI request command queue is empty. |
1201 | * This can happen when a request with conditionals doesn't | 1203 | * This can happen when a request with conditionals doesn't |