浏览代码

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 <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Johan Hedberg 9 年之前
父节点
当前提交
568f44f636
共有 1 个文件被更改,包括 7 次插入1 次删除
  1. 7 1
      net/bluetooth/hci_request.c

+ 7 - 1
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
 		 * trigger any commands to be sent. This is normal behavior
 		 * and should not trigger an error return.
 		 * and should not trigger an error return.
 		 */
 		 */
-		if (err == -ENODATA)
+		if (err == -ENODATA) {
+			if (hci_status)
+				*hci_status = 0;
 			return 0;
 			return 0;
+		}
+
+		if (hci_status)
+			*hci_status = HCI_ERROR_UNSPECIFIED;
 
 
 		return err;
 		return err;
 	}
 	}