]> www.infradead.org Git - users/borneoa/openocd-next.git/commit
transport: fix incorrect statement
authorAntonio Borneo <borneo.antonio@gmail.com>
Thu, 1 May 2025 17:38:42 +0000 (19:38 +0200)
committerAntonio Borneo <borneo.antonio@gmail.com>
Fri, 9 May 2025 12:10:05 +0000 (12:10 +0000)
commit00f5b7ece6f031ece824375007e825ffc113e72b
tree27f6475d16554c16006d4c296c8c9f4d872df81b
parent06c827757b0c44bef5a15558a71ab666375cbb87
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 <borneo.antonio@gmail.com>
Fixes: 236208a5ff2d ("transport: use a bitmask for the transport")
Reviewed-on: https://review.openocd.org/c/openocd/+/8868
Tested-by: jenkins
src/transport/transport.c