Skip to content

Commit 1e3c94e

Browse files
committed
bluetooth: host: conn: handle bt_le_create_conn_cancel error
Handle the `bt_le_create_conn_cancel` call in the deferred worker failing due to insufficient command buffers. Signed-off-by: Jordan Yates <[email protected]>
1 parent 857286b commit 1e3c94e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

subsys/bluetooth/host/conn.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2246,7 +2246,10 @@ static void deferred_work(struct k_work *work)
22462246
* auto connect flag if it was set, instead just cancel
22472247
* connection directly
22482248
*/
2249-
bt_le_create_conn_cancel();
2249+
if (bt_le_create_conn_cancel() == -ENOBUFS) {
2250+
LOG_WRN("No buffers to cancel connection, retrying in 10 ms");
2251+
k_work_reschedule(dwork, K_MSEC(10));
2252+
}
22502253
return;
22512254
}
22522255

0 commit comments

Comments
 (0)