openocd: fix simple cases of NULL comparison
[fw/openocd] / src / flash / nor / pic32mx.c
index 38f900f3e9532a9675c80e98dbaa4011f2a2db4f..5e6c99f13580081d64f990e4fe31cf9925c3a9c5 100644 (file)
@@ -515,7 +515,7 @@ static int pic32mx_write_block(struct flash_bank *bank, const uint8_t *buffer,
        uint8_t *new_buffer = NULL;
        if (row_offset && (count >= (row_size / 4))) {
                new_buffer = malloc(buffer_size);
-               if (new_buffer == NULL) {
+               if (!new_buffer) {
                        LOG_ERROR("Out of memory");
                        return ERROR_FAIL;
                }