From: OpenOCD-Gerrit <ope...@us...> - 2022-06-10 21:54:45
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 95135b39ccc3d8cec79053a71d0289e7fdeeafe9 (commit) via aee7c70a1a710ba8442b1aabff16d2f28eec2db2 (commit) from 63e22d5fb97fd99d88d840e88a25aff721e0424b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 95135b39ccc3d8cec79053a71d0289e7fdeeafe9 Author: Antonio Borneo <bor...@gm...> Date: Wed Jun 1 19:21:44 2022 +0200 arm_adi_v5: fix scan-build warning [3/3] While scan-build complains that dap_p or ap_num_p could be NULL, the current code never passes NULL pointers. Add an assert() to silent scan-build and prevent any further use of the function with incorrect parameters. Change-Id: I656810dddcea61e85d85b13efb114f7607ef837c Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/7012 Tested-by: jenkins Reviewed-by: Tomas Vanek <va...@fb...> diff --git a/src/target/arm_adi_v5.c b/src/target/arm_adi_v5.c index 0b11e815d..52b12cb93 100644 --- a/src/target/arm_adi_v5.c +++ b/src/target/arm_adi_v5.c @@ -1938,6 +1938,8 @@ static const struct jim_nvp nvp_config_opts[] = { static int adiv5_jim_spot_configure(struct jim_getopt_info *goi, struct adiv5_dap **dap_p, int *ap_num_p, uint32_t *base_p) { + assert(dap_p && ap_num_p); + if (!goi->argc) return JIM_OK; commit aee7c70a1a710ba8442b1aabff16d2f28eec2db2 Author: Antonio Borneo <bor...@gm...> Date: Wed Jun 1 19:02:54 2022 +0200 arm_adi_v5: fix scan-build warning [2/3] Commit d01b3d69ec17 ("arm_adi_v5: separate ROM table parsing from command output [3/3]") introduces a new scan-build warning because removing one return in case of error causes using uninitialized values. Add back the return on error. Change-Id: I10ddc548b756d34aaccc0511f091b4caa5ec271a Signed-off-by: Antonio Borneo <bor...@gm...> Fixes: d01b3d69ec17 ("arm_adi_v5: separate ROM table parsing from command output [3/3]") Reviewed-on: https://review.openocd.org/c/openocd/+/7011 Tested-by: jenkins Reviewed-by: Tomas Vanek <va...@fb...> diff --git a/src/target/arm_adi_v5.c b/src/target/arm_adi_v5.c index f7b335d95..0b11e815d 100644 --- a/src/target/arm_adi_v5.c +++ b/src/target/arm_adi_v5.c @@ -1552,8 +1552,10 @@ static int rtp_rom_loop(const struct rtp_ops *ops, } if (retval == ERROR_OK) retval = dap_run(ap->dap); - if (retval != ERROR_OK) + if (retval != ERROR_OK) { LOG_DEBUG("Failed read ROM table entry"); + return retval; + } if (width == 64) { romentry = (((uint64_t)romentry_high) << 32) | romentry_low; ----------------------------------------------------------------------- Summary of changes: src/target/arm_adi_v5.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) hooks/post-receive -- Main OpenOCD repository |