|
From: openocd-gerrit <ope...@us...> - 2023-05-06 13:33:03
|
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 92c1bee18c8268511de3478aabd226ce4f92322a (commit)
from dd9137dc0e0c9a7dd3468ecb7adb0427b8f06715 (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 92c1bee18c8268511de3478aabd226ce4f92322a
Author: Antonio Borneo <bor...@gm...>
Date: Sat May 6 10:16:08 2023 +0200
jtag: xds110: fix check on malloc() returned pointer
Commit 07e1ebcc12cd ("jtag: drivers: with pointers, use NULL
instead of 0") incorrectly inverts the check, making the driver's
pathmove operation not functional and triggering two clang errors.
Fix the check on malloc() returned pointer.
Change-Id: If1f220aca67452adbcd3a1c9cf691fc984b16b27
Signed-off-by: Antonio Borneo <bor...@gm...>
Fixes: 07e1ebcc12cd ("jtag: drivers: with pointers, use NULL instead of 0")
Reviewed-on: https://review.openocd.org/c/openocd/+/7656
Tested-by: jenkins
diff --git a/src/jtag/drivers/xds110.c b/src/jtag/drivers/xds110.c
index 3ea98ad6b..371dc8803 100644
--- a/src/jtag/drivers/xds110.c
+++ b/src/jtag/drivers/xds110.c
@@ -1688,7 +1688,7 @@ static void xds110_execute_pathmove(struct jtag_command *cmd)
return;
path = malloc(num_states * sizeof(uint8_t));
- if (path) {
+ if (!path) {
LOG_ERROR("XDS110: unable to allocate memory");
return;
}
-----------------------------------------------------------------------
Summary of changes:
src/jtag/drivers/xds110.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
hooks/post-receive
--
Main OpenOCD repository
|