summaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorMichał Narajowski <michal.narajowski@codecoup.pl>2016-09-19 14:33:33 +0200
committerJohan Hedberg <johan.hedberg@intel.com>2016-09-19 21:48:22 +0300
commitaf4168c5a925dc3b11b0246c2b91124327919f47 (patch)
tree08409e95092fbcc63a8108e68a56c5b9fa69f8ab /net/bluetooth
parente74317f43f5ce2d13cddaab867c59d42934d9585 (diff)
downloadlinux-stable-af4168c5a925dc3b11b0246c2b91124327919f47.tar.gz
linux-stable-af4168c5a925dc3b11b0246c2b91124327919f47.tar.bz2
linux-stable-af4168c5a925dc3b11b0246c2b91124327919f47.zip
Bluetooth: Set appearance only for LE capable controllers
Setting appearance on controllers without LE support will result in No Supported error. Signed-off-by: Michał Narajowski <michal.narajowski@codecoup.pl> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/mgmt.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index cd9f345894e0..7b2bac492fb1 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -3178,6 +3178,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);