Skip to content

Commit 24c7ad3

Browse files
jori-nordicfabiobaltieri
authored andcommitted
Bluetooth: conn: check k_work_submit() retcode
We still don't know how to handle it but at least it's checked now. Signed-off-by: Jonathan Rico <[email protected]>
1 parent fd8ca83 commit 24c7ad3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

subsys/bluetooth/host/conn.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,16 +387,20 @@ static void wait_for_tx_work(struct bt_conn *conn)
387387
tx_notify(conn);
388388
} else {
389389
struct k_work_sync sync;
390+
int err;
390391

391392
/* API docs mention undefined behavior if syncing on work item
392393
* from wq execution context.
393394
*/
394395
__ASSERT_NO_MSG(k_current_get() !=
395396
k_work_queue_thread_get(&k_sys_work_q));
396397

397-
k_work_submit(&conn->tx_complete_work);
398+
err = k_work_submit(&conn->tx_complete_work);
399+
__ASSERT(err >= 0, "couldn't submit (err %d)", err);
400+
398401
k_work_flush(&conn->tx_complete_work, &sync);
399402
}
403+
LOG_DBG("done");
400404
#else
401405
ARG_UNUSED(conn);
402406
#endif /* CONFIG_BT_CONN_TX */

0 commit comments

Comments
 (0)