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>
This commit is contained in:
committed by
Matthias Welwarsky
parent
0d48104e03
commit
7a3eec2b4d
@@ -388,6 +388,9 @@ int armv7m_start_algorithm(struct target *target,
|
||||
}
|
||||
|
||||
for (int i = 0; i < num_reg_params; i++) {
|
||||
if (reg_params[i].direction == PARAM_IN)
|
||||
continue;
|
||||
|
||||
struct reg *reg =
|
||||
register_get_by_name(armv7m->arm.core_cache, reg_params[i].reg_name, 0);
|
||||
/* uint32_t regvalue; */
|
||||
|
||||
Reference in New Issue
Block a user