Bluetooth: Fix printing errors if LE Connection times out
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Fri, 24 Mar 2023 20:18:20 +0000 (13:18 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 20 Apr 2023 10:35:09 +0000 (12:35 +0200)
commit99f1bc32ebcb403b02807e578dddbb0e9a3956f0
treedddaa8098fc96b86d0d240cba919bd007ac43f37
parent7c90d78301f8f880d1e2392e7e56a9b58f3f707a
Bluetooth: Fix printing errors if LE Connection times out

[ Upstream commit b62e72200eaad523f08d8319bba50fc652e032a8 ]

This fixes errors like bellow when LE Connection times out since that
is actually not a controller error:

 Bluetooth: hci0: Opcode 0x200d failed: -110
 Bluetooth: hci0: request failed to create LE connection: err -110

Instead the code shall properly detect if -ETIMEDOUT is returned and
send HCI_OP_LE_CREATE_CONN_CANCEL to give up on the connection.

Link: https://github.com/bluez/bluez/issues/340
Fixes: 8e8b92ee60de ("Bluetooth: hci_sync: Add hci_le_create_conn_sync")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/net/bluetooth/hci_core.h
net/bluetooth/hci_conn.c
net/bluetooth/hci_event.c
net/bluetooth/hci_sync.c