jtag: xds110: fix check on malloc() returned pointer
Commit07e1ebcc12
("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 <borneo.antonio@gmail.com> Fixes:07e1ebcc12
("jtag: drivers: with pointers, use NULL instead of 0") Reviewed-on: https://review.openocd.org/c/openocd/+/7656 Tested-by: jenkins
This commit is contained in:
parent
dd9137dc0e
commit
92c1bee18c
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue