Skip to content

Commit c7211db

Browse files
authored
Fixed assert when calling cancel_alarm(0) (#1173)
1 parent 826efbc commit c7211db

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/common/pico_time/time.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ alarm_id_t alarm_pool_add_alarm_at_force_in_context(alarm_pool_t *pool, absolute
291291
}
292292

293293
bool alarm_pool_cancel_alarm(alarm_pool_t *pool, alarm_id_t alarm_id) {
294+
if (!alarm_id) return false;
294295
bool rc = false;
295296
uint32_t save = spin_lock_blocking(pool->lock);
296297
pheap_node_id_t id = (pheap_node_id_t) alarm_id;

0 commit comments

Comments
 (0)