Bluetooth: Fix returning proper HCI status from __hci_req_sync
authorJohan Hedberg <johan.hedberg@intel.com>
Mon, 23 Nov 2015 12:40:47 +0000 (14:40 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Mon, 23 Nov 2015 12:50:11 +0000 (13:50 +0100)
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>
net/bluetooth/hci_request.c

index 76bd912be9fe16ea3abf862e9568f449437db571..e639671f54bd08a23f630b142cea990d005d73c6 100644 (file)
@@ -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;
        }