From: Øyvind Harboe Date: Mon, 7 Nov 2011 06:24:42 +0000 (+0100) Subject: xsvf: add missing error propagation X-Git-Tag: v0.6.0-rc1~451 X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=commitdiff_plain;h=3bab8990635af47de01e86c32a8ee9fe87789190 xsvf: add missing error propagation Change-Id: Ibc70deb980d6d18ceb376b72d9104e6180b16acf Signed-off-by: Øyvind Harboe Reviewed-on: http://openocd.zylin.com/176 Tested-by: jenkins Reviewed-by: Spencer Oliver --- diff --git a/src/xsvf/xsvf.c b/src/xsvf/xsvf.c index 31c3949938..14b9e28d89 100644 --- a/src/xsvf/xsvf.c +++ b/src/xsvf/xsvf.c @@ -510,14 +510,19 @@ COMMAND_HANDLER(handle_xsvf_command) if (xruntest) { result = svf_add_statemove(TAP_IDLE); + if (result != ERROR_OK) + return result; if (runtest_requires_tck) jtag_add_clocks(xruntest); else jtag_add_sleep(xruntest); - } - else if (xendir != TAP_DRPAUSE) /* we are already in TAP_DRPAUSE */ + } else if (xendir != TAP_DRPAUSE) { + /* we are already in TAP_DRPAUSE */ result = svf_add_statemove(xenddr); + if (result != ERROR_OK) + return result; + } } break; @@ -790,8 +795,12 @@ COMMAND_HANDLER(handle_xsvf_command) { /* FIXME handle statemove errors ... */ result = svf_add_statemove(wait_state); + if (result != ERROR_OK) + return result; jtag_add_sleep(delay); result = svf_add_statemove(end_state); + if (result != ERROR_OK) + return result; } } break; @@ -846,12 +855,16 @@ COMMAND_HANDLER(handle_xsvf_command) /* FIXME handle statemove errors ... */ result = svf_add_statemove(wait_state); + if (result != ERROR_OK) + return result; jtag_add_clocks(clock_count); jtag_add_sleep(usecs); result = svf_add_statemove(end_state); + if (result != ERROR_OK) + return result; } break; @@ -925,6 +938,8 @@ COMMAND_HANDLER(handle_xsvf_command) struct scan_field field; result = svf_add_statemove(loop_state); + if (result != ERROR_OK) + return result; jtag_add_clocks(loop_clocks); jtag_add_sleep(loop_usecs); @@ -1003,7 +1018,11 @@ COMMAND_HANDLER(handle_xsvf_command) /* upon error, return the TAPs to a reasonable state */ result = svf_add_statemove(TAP_IDLE); + if (result != ERROR_OK) + return result; result = jtag_execute_queue(); + if (result != ERROR_OK) + return result; break; } }