This is an automated email from Gerrit.

"Antonio Borneo <[email protected]>" just uploaded a new patch set to 
Gerrit, which you can find at https://review.openocd.org/c/openocd/+/9739

-- gerrit

commit b273a8959eaa9417f6fbcb7b9d7baff4276fba64
Author: Antonio Borneo <[email protected]>
Date:   Thu Jun 11 17:05:28 2026 +0200

    jtag: core: quit jtag_add_pathmove() if nothing to do
    
    If jtag_add_pathmove() is called with num_states set to zero it
    means there is nothing to do.
    
    Check num_states and quit if it is zero.
    
    Change-Id: I254a6f84c57d52ca50bfb911d572346a8b10ee3c
    Signed-off-by: Antonio Borneo <[email protected]>
    Reported-by: Evgeniy Naydanov <[email protected]>

diff --git a/src/jtag/core.c b/src/jtag/core.c
index 08228c0245..7e7b84d6d1 100644
--- a/src/jtag/core.c
+++ b/src/jtag/core.c
@@ -519,6 +519,10 @@ void jtag_add_pathmove(unsigned int num_states, const enum 
tap_state *path)
 {
        enum tap_state cur_state = cmd_queue_cur_state;
 
+       // quit if there is nothing to do
+       if (num_states == 0)
+               return;
+
        /* the last state has to be a stable state */
        if (!tap_is_state_stable(path[num_states - 1])) {
                LOG_ERROR("BUG: TAP path doesn't finish in a stable state");

-- 

Reply via email to