提交 22a3ceab 编写于 作者: J Johan Hedberg 提交者: Marcel Holtmann

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: NKirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
Tested-by: NKirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
上级 a86c02ea
...@@ -1128,6 +1128,7 @@ struct sk_buff *__hci_cmd_sync_ev(struct hci_dev *hdev, u16 opcode, u32 plen, ...@@ -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); err = hci_req_run(&req, hci_req_sync_complete);
if (err < 0) { if (err < 0) {
remove_wait_queue(&hdev->req_wait_q, &wait); remove_wait_queue(&hdev->req_wait_q, &wait);
set_current_state(TASK_RUNNING);
return ERR_PTR(err); return ERR_PTR(err);
} }
...@@ -1196,6 +1197,7 @@ static int __hci_req_sync(struct hci_dev *hdev, ...@@ -1196,6 +1197,7 @@ static int __hci_req_sync(struct hci_dev *hdev,
hdev->req_status = 0; hdev->req_status = 0;
remove_wait_queue(&hdev->req_wait_q, &wait); remove_wait_queue(&hdev->req_wait_q, &wait);
set_current_state(TASK_RUNNING);
/* ENODATA means the HCI request command queue is empty. /* ENODATA means the HCI request command queue is empty.
* This can happen when a request with conditionals doesn't * This can happen when a request with conditionals doesn't
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册