diff options
author | Antonio Borneo <borneo.antonio@gmail.com> | 2022-06-25 12:40:24 +0200 |
---|---|---|
committer | Antonio Borneo <borneo.antonio@gmail.com> | 2022-07-02 08:27:31 +0000 |
commit | b7125c369c4e5bde86d6688cbd1b7a87384d3d24 (patch) | |
tree | acbf4996dfe7a7b0d55bc5545df967d78f6c7f00 | |
parent | 06c3240155ccbb22b2db5782ffedf1e0c544b073 (diff) | |
download | riscv-openocd-b7125c369c4e5bde86d6688cbd1b7a87384d3d24.zip riscv-openocd-b7125c369c4e5bde86d6688cbd1b7a87384d3d24.tar.gz riscv-openocd-b7125c369c4e5bde86d6688cbd1b7a87384d3d24.tar.bz2 |
target: esp_xtensa_smp: fix clang report
The variable 'smp_break' is only set and used in case of smp.
But clang cannot track if 'target->smp' get modified between the
set and the use of 'smp_break', so it consider possible to use
'smp_break' uninitialized.
Initialize 'smp_break' to silent clang.
Change-Id: Ifa25a84fe9ffa25b8b58d7920ec77994c3b7ebfe
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Fixes: 77287b8d47b4 ("target: add Espressif ESP32 basic support")
Reviewed-on: https://review.openocd.org/c/openocd/+/7050
Reviewed-by: Erhan Kurubas <erhan.kurubas@espressif.com>
Tested-by: jenkins
-rw-r--r-- | src/target/espressif/esp_xtensa_smp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/target/espressif/esp_xtensa_smp.c b/src/target/espressif/esp_xtensa_smp.c index 1c36a29..d51906b 100644 --- a/src/target/espressif/esp_xtensa_smp.c +++ b/src/target/espressif/esp_xtensa_smp.c @@ -386,7 +386,7 @@ int esp_xtensa_smp_step(struct target *target, int handle_breakpoints) { int res; - uint32_t smp_break; + uint32_t smp_break = 0; struct esp_xtensa_smp_common *esp_xtensa_smp = target_to_esp_xtensa_smp(target); if (target->smp) { |