Skip to content
Snippets Groups Projects
Commit 5e61a630 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Check startup_future before using it"

parents 2157782f d7aefbf8
No related branches found
No related tags found
No related merge requests found
...@@ -342,6 +342,9 @@ static void event_finish_startup(UNUSED_ATTR void* context) { ...@@ -342,6 +342,9 @@ static void event_finish_startup(UNUSED_ATTR void* context) {
std::lock_guard<std::recursive_timed_mutex> lock( std::lock_guard<std::recursive_timed_mutex> lock(
commands_pending_response_mutex); commands_pending_response_mutex);
alarm_cancel(startup_timer); alarm_cancel(startup_timer);
if (!startup_future) {
return;
}
future_ready(startup_future, FUTURE_SUCCESS); future_ready(startup_future, FUTURE_SUCCESS);
startup_future = NULL; startup_future = NULL;
} }
...@@ -358,9 +361,11 @@ static void startup_timer_expired(UNUSED_ATTR void* context) { ...@@ -358,9 +361,11 @@ static void startup_timer_expired(UNUSED_ATTR void* context) {
// hence abort. // hence abort.
abort(); abort();
} }
if (!startup_future) {
return;
}
future_ready(startup_future, FUTURE_FAIL); future_ready(startup_future, FUTURE_FAIL);
startup_future = NULL; startup_future = NULL;
lock.unlock();
} }
// Command/packet transmitting functions // Command/packet transmitting functions
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment