summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Fertser <fercerpav@gmail.com>2015-04-24 14:43:45 +0300
committerPaul Fertser <fercerpav@gmail.com>2015-04-24 14:49:06 +0100
commit528197ba2cf2b208efa4d5c8465a9044567e8d69 (patch)
treef9d22b71606a63c813c5b1a101a7c7a62d621971
parent68101e67ac16bdead3bd6d48cbe0a2bfd63aac02 (diff)
downloadopenocd-528197ba2cf2b208efa4d5c8465a9044567e8d69.tar.gz
openocd-528197ba2cf2b208efa4d5c8465a9044567e8d69.tar.xz
rtos/mqx: prevent crash with -rtos auto
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
-rw-r--r--src/rtos/mqx.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/rtos/mqx.c b/src/rtos/mqx.c
index a23a95c3..0ba462c9 100644
--- a/src/rtos/mqx.c
+++ b/src/rtos/mqx.c
@@ -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 */