Skip to content

Commit a0a9121

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 <luiz.von.dentz@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 3dede8e commit a0a9121

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
@@ -782,7 +782,8 @@ static u32 get_supported_settings(struct hci_dev *hdev)
782782

783783
if (lmp_ssp_capable(hdev)) {
784784
settings |= MGMT_SETTING_SSP;
785-
settings |= MGMT_SETTING_HS;
785+
if (IS_ENABLED(CONFIG_BT_HS))
786+
settings |= MGMT_SETTING_HS;
786787
}
787788

788789
if (lmp_sc_capable(hdev))
@@ -1815,6 +1816,10 @@ static int set_hs(struct sock *sk, struct hci_dev *hdev, void *data, u16 len)
18151816

18161817
bt_dev_dbg(hdev, "sock %p", sk);
18171818

1819+
if (!IS_ENABLED(CONFIG_BT_HS))
1820+
return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_HS,
1821+
MGMT_STATUS_NOT_SUPPORTED);
1822+
18181823
status = mgmt_bredr_support(hdev);
18191824
if (status)
18201825
return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_HS, status);

0 commit comments

Comments
 (0)