diff options
author | Walter Ji <walter.ji@oss.cipunited.com> | 2023-10-09 11:42:44 +0800 |
---|---|---|
committer | Antonio Borneo <borneo.antonio@gmail.com> | 2023-10-25 01:34:00 +0000 |
commit | e887cfb9e8e8e42513b38e09960849becc5d42e3 (patch) | |
tree | 893cf21a2b630ad8ad9fa9ea4eed5e41fb5a8a0f /src | |
parent | 18c64af13500342da5dc304cb3f2024078815bd4 (diff) | |
download | riscv-openocd-e887cfb9e8e8e42513b38e09960849becc5d42e3.zip riscv-openocd-e887cfb9e8e8e42513b38e09960849becc5d42e3.tar.gz riscv-openocd-e887cfb9e8e8e42513b38e09960849becc5d42e3.tar.bz2 |
target/mips32: check read regs result in save context
Add result check for mips32_pracc_read_regs in mips32_save_context.
Change-Id: Ie796d2b05a9feb11e246c2d0771b52cad4fb70db
Signed-off-by: Walter Ji <walter.ji@oss.cipunited.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7932
Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/target/mips32.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/target/mips32.c b/src/target/mips32.c index 18160b2..99688b0 100644 --- a/src/target/mips32.c +++ b/src/target/mips32.c @@ -306,7 +306,11 @@ int mips32_save_context(struct target *target) struct mips32_common *mips32 = target_to_mips32(target); /* read core registers */ - mips32_pracc_read_regs(mips32); + int retval = mips32_pracc_read_regs(mips32); + if (retval != ERROR_OK) { + LOG_ERROR("Could not read core registers from target"); + return retval; + } for (i = 0; i < MIPS32_NUM_REGS; i++) { if (!mips32->core_cache->reg_list[i].valid) |