diff options
author | Tomas Vanek <vanekt@fbl.cz> | 2018-12-18 17:17:33 +0100 |
---|---|---|
committer | Matthias Welwarsky <matthias@welwarsky.de> | 2019-02-07 07:51:50 +0000 |
commit | 7a3eec2b4d9dbb9533acfb271dbe91afa0727c8e (patch) | |
tree | 8b8d19f57f6f12dec1c1c0b728f04f1c6309bbbf /src/flash/nor | |
parent | 0d48104e03320112db1e8825d0700ea8be735cef (diff) | |
download | riscv-openocd-7a3eec2b4d9dbb9533acfb271dbe91afa0727c8e.zip riscv-openocd-7a3eec2b4d9dbb9533acfb271dbe91afa0727c8e.tar.gz riscv-openocd-7a3eec2b4d9dbb9533acfb271dbe91afa0727c8e.tar.bz2 |
target algo: do not write reg_param if direction is PARAM_IN
Without this change xxx_start_algorithm() writes all register
parameters no matter of their direction. It usually results
in writing of uninitialized reg_params[].value - possibly
reported by valgrind.
While on it fix the wrong parameter direction in
kinetis_disable_wdog_algo(). This bug did not have any
impact because of unconditional write of reg_params.
Change-Id: Ia9c6a7b37f77d5eb6e5f5463012dddd50471742b
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/4813
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
Diffstat (limited to 'src/flash/nor')
-rw-r--r-- | src/flash/nor/kinetis.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/flash/nor/kinetis.c b/src/flash/nor/kinetis.c index 86fad72..eca74a8 100644 --- a/src/flash/nor/kinetis.c +++ b/src/flash/nor/kinetis.c @@ -1035,7 +1035,7 @@ static int kinetis_disable_wdog_algo(struct target *target, size_t code_size, co armv7m_info.common_magic = ARMV7M_COMMON_MAGIC; armv7m_info.core_mode = ARM_MODE_THREAD; - init_reg_param(®_params[0], "r0", 32, PARAM_IN); + init_reg_param(®_params[0], "r0", 32, PARAM_OUT); buf_set_u32(reg_params[0].value, 0, 32, wdog_base); retval = target_run_algorithm(target, 0, NULL, 1, reg_params, |