diff options
author | Tim Newsome <tim@sifive.com> | 2019-04-09 10:55:25 -0700 |
---|---|---|
committer | Tim Newsome <tim@sifive.com> | 2019-04-09 10:55:25 -0700 |
commit | d78ff5ab4e8c4655c8cc3db619c42c3f60454e7e (patch) | |
tree | 993bb9321925531ca1b3fdb24a4784fbfeba4299 | |
parent | 693c9c4f7e07d9a135dd3e6dae7240ec00875c3f (diff) | |
download | riscv-openocd-d78ff5ab4e8c4655c8cc3db619c42c3f60454e7e.zip riscv-openocd-d78ff5ab4e8c4655c8cc3db619c42c3f60454e7e.tar.gz riscv-openocd-d78ff5ab4e8c4655c8cc3db619c42c3f60454e7e.tar.bz2 |
Propagate some errors in execute_abstract_command().
Change-Id: Ia3ec457dd5d65378a6c922802713e36d6828bcea
-rw-r--r-- | src/target/riscv/riscv-013.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/target/riscv/riscv-013.c b/src/target/riscv/riscv-013.c index d7bfac9..86820df 100644 --- a/src/target/riscv/riscv-013.c +++ b/src/target/riscv/riscv-013.c @@ -744,13 +744,14 @@ static int execute_abstract_command(struct target *target, uint32_t command) } } - dmi_write_exec(target, DMI_COMMAND, command); + if (dmi_write_exec(target, DMI_COMMAND, command) != ERROR_OK) + return ERROR_FAIL; uint32_t abstractcs = 0; - wait_for_idle(target, &abstractcs); + int result = wait_for_idle(target, &abstractcs); info->cmderr = get_field(abstractcs, DMI_ABSTRACTCS_CMDERR); - if (info->cmderr != 0) { + if (info->cmderr != 0 || result != ERROR_OK) { LOG_DEBUG("command 0x%x failed; abstractcs=0x%x", command, abstractcs); /* Clear the error. */ dmi_write(target, DMI_ABSTRACTCS, set_field(0, DMI_ABSTRACTCS_CMDERR, |