Bluetooth: hci_core: Fix not handling link timeouts propertly
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Mon, 26 Sep 2022 22:44:42 +0000 (15:44 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Oct 2022 10:34:46 +0000 (12:34 +0200)
commit397e880acf441dd15e4bdbb14b4c36d3f358afab
tree8865413a9c3fa0225bc0ab858959da923218ebcc
parent1331d3e1f9b5060e159fba8c6fb3285ee5aa2857
Bluetooth: hci_core: Fix not handling link timeouts propertly

[ Upstream commit 116523c8fac05d1d26f748fee7919a4ec5df67ea ]

Change that introduced the use of __check_timeout did not account for
link types properly, it always assumes ACL_LINK is used thus causing
hdev->acl_last_tx to be used even in case of LE_LINK and then again
uses ACL_LINK with hci_link_tx_to.

To fix this __check_timeout now takes the link type as parameter and
then procedure to use the right last_tx based on the link type and pass
it to hci_link_tx_to.

Fixes: 1b1d29e51499 ("Bluetooth: Make use of __check_timeout on hci_sched_le")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Tested-by: David Beinder <david@beinder.at>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/bluetooth/hci_core.c