提交 920c8300 编写于 作者: A Andre Guedes 提交者: Gustavo Padovan

Bluetooth: Check hci_req_run returning value in __hci_req_sync

Since hci_req_run will be returning more than one error code, we
should check its returning value in __hci_req_sync.
Signed-off-by: NAndre Guedes <andre.guedes@openbossa.org>
Acked-by: NJohan Hedberg <johan.hedberg@intel.com>
Signed-off-by: NGustavo Padovan <gustavo.padovan@collabora.co.uk>
上级 382b0c39
...@@ -100,13 +100,16 @@ static int __hci_req_sync(struct hci_dev *hdev, ...@@ -100,13 +100,16 @@ static int __hci_req_sync(struct hci_dev *hdev,
err = hci_req_run(&req, hci_req_sync_complete); err = hci_req_run(&req, hci_req_sync_complete);
if (err < 0) { if (err < 0) {
hdev->req_status = 0; hdev->req_status = 0;
/* req_run will fail if the request did not add any
* commands to the queue, something that can happen when /* ENODATA means the HCI request command queue is empty.
* a request with conditionals doesn't trigger any * This can happen when a request with conditionals doesn't
* commands to be sent. This is normal behavior and * trigger any commands to be sent. This is normal behavior
* should not trigger an error return. * and should not trigger an error return.
*/ */
return 0; if (err == -ENODATA)
return 0;
return err;
} }
add_wait_queue(&hdev->req_wait_q, &wait); add_wait_queue(&hdev->req_wait_q, &wait);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册