Skip to content

Commit

Permalink
nimble/host: Added return type handling for npl_mutex_init
Browse files Browse the repository at this point in the history
  • Loading branch information
rahult-github authored and sjanc committed Sep 20, 2023
1 parent 9d4f474 commit 829e47b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 6 additions & 1 deletion nimble/host/src/ble_gap.c
Original file line number Diff line number Diff line change
Expand Up @@ -6596,7 +6596,12 @@ ble_gap_init(void)
memset(&ble_gap_sync, 0, sizeof(ble_gap_sync));
#endif

ble_npl_mutex_init(&preempt_done_mutex);
rc = ble_npl_mutex_init(&preempt_done_mutex);

if (rc) {
BLE_HS_LOG(ERROR, "mutex init failed with reason %d \n", rc);
return rc;
}

SLIST_INIT(&ble_gap_update_entries);
SLIST_INIT(&ble_gap_event_listener_list);
Expand Down
4 changes: 3 additions & 1 deletion nimble/transport/src/monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ void
ble_monitor_init(void)
{
SYSINIT_ASSERT_ACTIVE();
ble_npl_error_t rc;

#if MYNEWT_VAL(BLE_MONITOR_UART)
struct uart_conf uc = {
Expand Down Expand Up @@ -340,7 +341,8 @@ ble_monitor_init(void)
SYSINIT_PANIC_ASSERT(rtt_index >= 0);
#endif

ble_npl_mutex_init(&lock);
rc = ble_npl_mutex_init(&lock);
SYSINIT_PANIC_ASSERT(rc == 0);

#if BLE_MONITOR
ble_monitor_new_index(0, (uint8_t[6]){ }, "nimble0");
Expand Down

0 comments on commit 829e47b

Please sign in to comment.