Skip to content

Commit

Permalink
host/mesh: check ble_npl_time_ms_to_ticks error in k_sem_take
Browse files Browse the repository at this point in the history
  • Loading branch information
KKopyscinski committed Mar 4, 2024
1 parent dc368db commit b263359
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion nimble/host/mesh/include/mesh/glue.h
Original file line number Diff line number Diff line change
Expand Up @@ -560,8 +560,12 @@ static inline void k_sem_init(struct k_sem *sem, unsigned int initial_count,
static inline int k_sem_take(struct k_sem *sem, int32_t timeout)
{
uint32_t ticks;
int rc;

ble_npl_time_ms_to_ticks(timeout, &ticks);
rc = ble_npl_time_ms_to_ticks(timeout, &ticks);
if (rc) {
return rc;
}
return - ble_npl_sem_pend(sem, ticks);
}

Expand Down

0 comments on commit b263359

Please sign in to comment.