This is an automated email from Gerrit.

"Mark O'Donovan <[email protected]>" just uploaded a new patch set to Gerrit, 
which you can find at https://review.openocd.org/c/openocd/+/9501

-- gerrit

commit dc8f1599db9aad8c40d25fcd3a27f9ca4bf92164
Author: Mark O'Donovan <[email protected]>
Date:   Tue Feb 24 20:37:06 2026 +0000

    rtos/hwthread: move pointer deref after NULL check
    
    Move pointer deref after NULL check.
    Found by cppcheck.
    
    Change-Id: I41b20a0598da83b6d7e353042b6f69e7a58706fc
    Signed-off-by: Mark O'Donovan <[email protected]>

diff --git a/src/rtos/hwthread.c b/src/rtos/hwthread.c
index d422fac53d..9367f70af4 100644
--- a/src/rtos/hwthread.c
+++ b/src/rtos/hwthread.c
@@ -94,12 +94,13 @@ static int hwthread_update_threads(struct rtos *rtos)
        struct target_list *head;
        struct target *target;
        int64_t current_thread = 0;
-       int64_t current_threadid = rtos->current_threadid; /* thread selected 
by GDB */
+       int64_t current_threadid;
        enum target_debug_reason current_reason = DBG_REASON_UNDEFINED;
 
        if (!rtos)
                return -1;
 
+       current_threadid = rtos->current_threadid; /* thread selected by GDB */
        target = rtos->target;
 
        /* wipe out previous thread details if any */

-- 

Reply via email to