Skip to content
Snippets Groups Projects
Commit 44a0981c authored by Beat Küng's avatar Beat Küng
Browse files

fix px4_task_spawn_cmd: unlock mutex if pthread_create fails

parent 99a682e7
No related branches found
No related tags found
No related merge requests found
......@@ -240,11 +240,13 @@ px4_task_t px4_task_spawn_cmd(const char *name, int scheduler, int priority, int
if (rv != 0) {
PX4_ERR("px4_task_spawn_cmd: failed to create thread %d %d\n", rv, errno);
taskmap[taskid].isused = false;
pthread_mutex_unlock(&task_mutex);
free(taskdata);
return (rv < 0) ? rv : -rv;
}
} else {
pthread_mutex_unlock(&task_mutex);
free(taskdata);
return (rv < 0) ? rv : -rv;
}
......
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