Skip to content

Commit

Permalink
Bluetooth: Fix returning proper HCI status from __hci_req_sync
Browse files Browse the repository at this point in the history
There were a couple of code paths missed by the previous patch that
added a HCI status return parameter to __hci_req_sync. This patch adds
the missing assignments for them.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
  • Loading branch information
Johan Hedberg authored and Marcel Holtmann committed Nov 23, 2015
1 parent 40b25fe commit 568f44f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion net/bluetooth/hci_request.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,14 @@ int __hci_req_sync(struct hci_dev *hdev, int (*func)(struct hci_request *req,
* trigger any commands to be sent. This is normal behavior
* and should not trigger an error return.
*/
if (err == -ENODATA)
if (err == -ENODATA) {
if (hci_status)
*hci_status = 0;
return 0;
}

if (hci_status)
*hci_status = HCI_ERROR_UNSPECIFIED;

return err;
}
Expand Down

0 comments on commit 568f44f

Please sign in to comment.