From: Johan Hedberg Date: Mon, 23 Nov 2015 12:40:47 +0000 (+0200) Subject: Bluetooth: Fix returning proper HCI status from __hci_req_sync X-Git-Tag: android-x86-7.1-r1~1864^2~588^2~2 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=568f44f63621e00af9895f09c70aa38025be8813;p=android-x86%2Fkernel.git Bluetooth: Fix returning proper HCI status from __hci_req_sync 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 Signed-off-by: Marcel Holtmann --- diff --git a/net/bluetooth/hci_request.c b/net/bluetooth/hci_request.c index 76bd912be9fe..e639671f54bd 100644 --- a/net/bluetooth/hci_request.c +++ b/net/bluetooth/hci_request.c @@ -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; }