]> git.ipfire.org Git - thirdparty/linux.git/commit
Bluetooth: hci_core: Fix not handling hdev->le_num_of_adv_sets=1
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Mon, 13 May 2024 20:07:55 +0000 (16:07 -0400)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Tue, 14 May 2024 14:56:37 +0000 (10:56 -0400)
commite77f43d531af41e9ce299eab10dcae8fa5dbc293
tree1b6eda311dc44d31e123e6d866604e54e4d078b7
parent36b1c9c35452d043ce2239a65393b3e7ee7101c5
Bluetooth: hci_core: Fix not handling hdev->le_num_of_adv_sets=1

If hdev->le_num_of_adv_sets is set to 1 it means that only handle 0x00
can be used, but since the MGMT interface instances start from 1
(instance 0 means all instances in case of MGMT_OP_REMOVE_ADVERTISING)
the code needs to map the instance to handle otherwise users will not be
able to advertise as instance 1 would attempt to use handle 0x01.

Fixes: 1d0fac2c38ed ("Bluetooth: Use controller sets when available")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
include/net/bluetooth/hci_core.h
net/bluetooth/hci_core.c
net/bluetooth/hci_sync.c