Skip to content

Commit 2ef5689

Browse files
Vudentzgregkh
authored andcommitted
Bluetooth: MGMT: Fix not checking if BT_HS is enabled
commit b560a20 upstream. 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 <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 7203696 commit 2ef5689

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

net/bluetooth/mgmt.c

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

636636
if (lmp_ssp_capable(hdev)) {
637637
settings |= MGMT_SETTING_SSP;
638-
settings |= MGMT_SETTING_HS;
638+
if (IS_ENABLED(CONFIG_BT_HS))
639+
settings |= MGMT_SETTING_HS;
639640
}
640641

641642
if (lmp_sc_capable(hdev))
@@ -1645,6 +1646,10 @@ static int set_hs(struct sock *sk, struct hci_dev *hdev, void *data, u16 len)
16451646

16461647
BT_DBG("request for %s", hdev->name);
16471648

1649+
if (!IS_ENABLED(CONFIG_BT_HS))
1650+
return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_HS,
1651+
MGMT_STATUS_NOT_SUPPORTED);
1652+
16481653
status = mgmt_bredr_support(hdev);
16491654
if (status)
16501655
return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_HS, status);

0 commit comments

Comments
 (0)