From: openocd-gerrit <ope...@us...> - 2025-05-09 12:10:41
|
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 00f5b7ece6f031ece824375007e825ffc113e72b (commit) from 06c827757b0c44bef5a15558a71ab666375cbb87 (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 00f5b7ece6f031ece824375007e825ffc113e72b Author: Antonio Borneo <bor...@gm...> Date: Thu May 1 19:38:42 2025 +0200 transport: fix incorrect statement Commit 236208a5ff2d ("transport: use a bitmask for the transport") has an incorrect C statement in place of a return. The code is working thanks to the previous condition never true. The issue has been detected by clang scan-build in OpenOCD ACI since the missing return can make the following statement dereferencing a NULL pointer. Fix it! Change-Id: I3bbe04d99ad9b1288f55ba3c45e2e487aef9ae40 Signed-off-by: Antonio Borneo <bor...@gm...> Fixes: 236208a5ff2d ("transport: use a bitmask for the transport") Reviewed-on: https://review.openocd.org/c/openocd/+/8868 Tested-by: jenkins diff --git a/src/transport/transport.c b/src/transport/transport.c index ab5be490f..5323a7ca0 100644 --- a/src/transport/transport.c +++ b/src/transport/transport.c @@ -258,7 +258,7 @@ struct transport *get_current_transport(void) const char *get_current_transport_name(void) { if (!session || !is_transport_id_valid(session->id)) - NULL; + return NULL; return transport_full_name(session->id); } ----------------------------------------------------------------------- Summary of changes: src/transport/transport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- Main OpenOCD repository |