Thread (5 messages) 5 messages, 3 authors, 2016-09-21

[PATCH] Bluetooth: Set appearance only for LE capable controllers

flat view
STALE3673d

From: Michał Narajowski <hidden>
Date: 2016-09-19 12:33:33
Subsystem: bluetooth subsystem, the rest · Maintainers: Marcel Holtmann, Luiz Augusto von Dentz, Linus Torvalds

Setting appearance on controllers without LE support will result
in No Supported error.

Signed-off-by: Michał Narajowski <redacted>
---
 net/bluetooth/mgmt.c | 4 ++++
 1 file changed, 4 insertions(+)
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 54dd218..4e37e7a 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -3153,6 +3153,10 @@ static int set_appearance(struct sock *sk, struct hci_dev *hdev, void *data,
 
 	BT_DBG("");
 
+	if (!lmp_le_capable(hdev))
+		return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_APPEARANCE,
+				       MGMT_STATUS_NOT_SUPPORTED);
+
 	apperance = le16_to_cpu(cp->appearance);
 
 	hci_dev_lock(hdev);
-- 
2.7.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help