Bluetooth: Reject device class changes when BR/EDR is not available
Subsystems (2)
Marcel Holtmann
maintainerPATCH 1/1 Bluetooth: Reject device class changes when BR/EDR is not available
On LE only controllers or dual mode controllers with BR/EDR disabled, it makes no sense to allow programming of the minor and major class values. In these cases, just reject the operation.
Signed-off-by Marcel Holtmann <[email protected]>
--- net/bluetooth/mgmt.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
net/bluetooth/mgmt.c +4 -3
@@ -1753,13 +1753,14 @@ static int set_dev_class(struct sock *sk, struct hci_dev *hdev, void *data,struct mgmt_cp_set_dev_class *cp = data;struct pending_cmd *cmd;struct hci_request req; +u8 status;int err;BT_DBG ("request for %s" , hdev->name); -if (!test_bit (HCI_BREDR_ENABLED , &hdev->dev_flags)) -return cmd_status (sk, hdev->id,MGMT_OP_SET_DEV_CLASS , -MGMT_STATUS_NOT_SUPPORTED ); + status =mgmt_bredr_support (hdev); +if (status) +return cmd_status (sk, hdev->id,MGMT_OP_SET_DEV_CLASS , status);hci_dev_lock (hdev);
Signature · 1 line
1.8.3.1