From: Michał Narajowski Date: Mon, 19 Sep 2016 12:33:33 +0000 (+0200) Subject: Bluetooth: Set appearance only for LE capable controllers X-Git-Tag: v4.9-rc1~127^2~128^2 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=4.8.0-rc6-354649-gaf4168c;p=karo-tx-linux.git 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 Signed-off-by: Johan Hedberg --- 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);