Skip to content

Commit 61f4af0

Browse files
author
Jarkko Paso
committed
FHSS timer driver: Check if timeout alloc fails
1 parent 1b01709 commit 61f4af0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

features/nanostack/nanostack-hal-mbed-cmsis-rtos/arm_hal_fhss_timer.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,11 @@ static int platform_fhss_timer_start(uint32_t slots, void (*callback)(const fhss
105105
if (!fhss_tim) {
106106
fhss_tim = allocate_timeout();
107107
}
108+
if (!fhss_tim) {
109+
platform_exit_critical();
110+
tr_error("Failed to allocate timeout");
111+
return ret_val;
112+
}
108113
fhss_tim->fhss_timer_callback = callback;
109114
fhss_tim->start_time = read_current_time();
110115
fhss_tim->stop_time = fhss_tim->start_time + slots;

0 commit comments

Comments
 (0)