]> git.sur5r.net Git - openocd/commitdiff
rtos/mqx: prevent crash with -rtos auto
authorPaul Fertser <fercerpav@gmail.com>
Fri, 24 Apr 2015 11:43:45 +0000 (14:43 +0300)
committerPaul Fertser <fercerpav@gmail.com>
Fri, 24 Apr 2015 13:49:06 +0000 (14:49 +0100)
Since mqx comes last in the list, with the auto option its
update_threads is called even though it wasn't detected.

This check should be removed from all the rtos helpers and moved to
the generic code, but better do it later all in one go.

Change-Id: If24ab42a58a468d90e9f12028d4c2fb76a9bc2e8
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2741
Tested-by: jenkins
src/rtos/mqx.c

index a23a95c3487cd039e3254ea8fa030ed587cd49bd..0ba462c9a7b5f7723a8db4e9d5b9ed4ba897beeb 100644 (file)
@@ -292,6 +292,12 @@ static int mqx_update_threads(
        uint16_t task_queue_size = 0;
        uint32_t active_td_addr = 0;
 
+       if (!rtos->rtos_specific_params)
+               return -3;
+
+       if (!rtos->symbols)
+               return -4;
+
        /* clear old data */
        rtos_free_threadlist(rtos);
        /* check scheduler */