Skip to content

Commit b560a20

Browse files
Vudentzholtmann
authored andcommitted
Bluetooth: MGMT: Fix not checking if BT_HS is enabled
This checks if BT_HS is enabled relecting it on MGMT_SETTING_HS instead of always reporting it as supported. Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
1 parent b176dd0 commit b560a20

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎net/bluetooth/mgmt.c‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,8 @@ static u32 get_supported_settings(struct hci_dev *hdev)
784784

785785
if (lmp_ssp_capable(hdev)) {
786786
settings |= MGMT_SETTING_SSP;
787-
settings |= MGMT_SETTING_HS;
787+
if (IS_ENABLED(CONFIG_BT_HS))
788+
settings |= MGMT_SETTING_HS;
788789
}
789790

790791
if (lmp_sc_capable(hdev))
@@ -1817,6 +1818,10 @@ static int set_hs(struct sock *sk, struct hci_dev *hdev, void *data, u16 len)
18171818

18181819
bt_dev_dbg(hdev, "sock %p", sk);
18191820

1821+
if (!IS_ENABLED(CONFIG_BT_HS))
1822+
return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_HS,
1823+
MGMT_STATUS_NOT_SUPPORTED);
1824+
18201825
status = mgmt_bredr_support(hdev);
18211826
if (status)
18221827
return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_HS, status);

0 commit comments

Comments
 (0)