This is an automated email from Gerrit.

"Antonio Borneo <borneo.anto...@gmail.com>" just uploaded a new patch set to 
Gerrit, which you can find at https://review.openocd.org/c/openocd/+/7656

-- gerrit

commit adb1ec7539a9db5ffbc368989b2b87c6de31ad46
Author: Antonio Borneo <borneo.anto...@gmail.com>
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 <borneo.anto...@gmail.com>
    Fixes: 07e1ebcc12cd ("jtag: drivers: with pointers, use NULL instead of 0")

diff --git a/src/jtag/drivers/xds110.c b/src/jtag/drivers/xds110.c
index 3ea98ad6b1..371dc88034 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;
        }

-- 

Reply via email to