Skip to content

Commit

Permalink
Bluetooth: Set appearance only for LE capable controllers
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Michał Narajowski authored and Johan Hedberg committed Sep 19, 2016
1 parent e74317f commit af4168c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions net/bluetooth/mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit af4168c

Please sign in to comment.