Skip to contentSkip to conversation

Bluetooth: Fix returning proper HCI status from __hci_req_sync

PATCH In review Johan Hedberg 2 participants 2 messages Nov 23, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Bluetooth: Fix returning proper HCI status from __hci_req_sync

From: Johan Hedberg <[email protected]>

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.

---
 net/bluetooth/hci_request.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
net/bluetooth/hci_request.c +7 -1
index 76bd912be9fe..e639671f54bd 100644
@@ -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;
 	}
Signature · 1 line
2.5.0
maintainer
#1 lore raw

Hi Johan,

Quoted 8 lines

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.

---
net/bluetooth/hci_request.c | 8 +++++++-

1 file changed, 7 insertions(+), 1 deletion(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel