]> git.baikalelectronics.ru Git - kernel.git/commit
Bluetooth: Fix removing adv when processing cmd complete
authorArchie Pusaka <apusaka@chromium.org>
Thu, 28 Oct 2021 11:17:25 +0000 (19:17 +0800)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Thu, 28 Oct 2021 22:11:04 +0000 (15:11 -0700)
commite73104a122e8343cde9fd033abc583f550daf37d
tree55d6f65fb5eb2b72e2d0384df8970c6237a468d6
parent69599d9b271aff6395c907d653b70c670bf28f7f
Bluetooth: Fix removing adv when processing cmd complete

If we remove one instance of adv using Set Extended Adv Enable, there
is a possibility of issue occurs when processing the Command Complete
event. Especially, the adv_info might not be found since we already
remove it in hci_req_clear_adv_instance() -> hci_remove_adv_instance().
If that's the case, we will mistakenly proceed to remove all adv
instances instead of just one single instance.

This patch fixes the issue by checking the content of the HCI command
instead of checking whether the adv_info is found.

Signed-off-by: Archie Pusaka <apusaka@chromium.org>
Reviewed-by: Sonny Sasaka <sonnysasaka@chromium.org>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
net/bluetooth/hci_event.c