bluetooth:Fix error handling in the function le_conn_timeout
Subsystems (2)
PATCH 1/1 bluetooth:Fix error handling in the function le_conn_timeout
This fixes error handling in the function le_conn_timeout by checking if the internal call to the function hci_send_cmd has failed by returning a error and if so return immediately to this function's caller as we cannot continue this function's work after this failed function call.
Signed-off-by Nicholas Krause <[email protected]>
--- net/bluetooth/hci_conn.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
net/bluetooth/hci_conn.c +3 -2
@@ -420,8 +420,9 @@ static void le_conn_timeout(struct work_struct *work)*/ if (conn->role ==HCI_ROLE_SLAVE ) {u8 enable =0x00 ; -hci_send_cmd (hdev,HCI_OP_LE_SET_ADV_ENABLE ,sizeof (enable), - &enable); +if (hci_send_cmd (hdev,HCI_OP_LE_SET_ADV_ENABLE ,sizeof (enable), + &enable)) +return ;hci_le_conn_failed (conn,HCI_ERROR_ADVERTISING_TIMEOUT );return ; }
Signature · 1 line
2.1.4