|
From: openocd-gerrit <ope...@us...> - 2023-05-18 10:19:35
|
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 3c2cc6efb8c9e892b2a1297ff3147c1d726a8937 (commit)
from f20173a01f3eec286b2e2daac12834229cbfa3c8 (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 3c2cc6efb8c9e892b2a1297ff3147c1d726a8937
Author: Antonio Borneo <bor...@gm...>
Date: Sat May 6 10:34:13 2023 +0200
pld/virtex2: check error propagated by virtex2_read_stat()
Commit dd9137dc0e0c ("pld/virtex2: add missing error checks") adds
checks on the return value of several functions, allowing also
virtex2_read_stat() to propagate such returned values.
This triggers an error with clang, as it is now able to identify a
possible execution path that makes uninitialized the variable
status.
Check for the returned value of virtex2_read_stat() before using
the variable status and propagate the returned value.
While there, drop a useless empty string.
Change-Id: I7a23d3f904d4e07cdb6f6dfdf1179889b6b8afb8
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/7657
Reviewed-by: Daniel Anselmi <dan...@gm...>
Tested-by: jenkins
Reviewed-by: Tomas Vanek <va...@fb...>
diff --git a/src/pld/virtex2.c b/src/pld/virtex2.c
index 3c174ae59..fd0725a63 100644
--- a/src/pld/virtex2.c
+++ b/src/pld/virtex2.c
@@ -241,9 +241,13 @@ COMMAND_HANDLER(virtex2_handle_read_stat_command)
return ERROR_FAIL;
}
- virtex2_read_stat(device, &status);
+ int retval = virtex2_read_stat(device, &status);
+ if (retval != ERROR_OK) {
+ command_print(CMD, "cannot read virtex2 status register");
+ return retval;
+ }
- command_print(CMD, "virtex2 status register: 0x%8.8" PRIx32 "", status);
+ command_print(CMD, "virtex2 status register: 0x%8.8" PRIx32, status);
return ERROR_OK;
}
-----------------------------------------------------------------------
Summary of changes:
src/pld/virtex2.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|