openocd: fix simple cases of NULL comparison
[fw/openocd] / src / target / openrisc / or1k_du_adv.c
index 31b248776312f81af5c8511516d87b3b5d8e12bf..885fcb9c107a66890c0f0ab16161b2f1320fbb75 100644 (file)
@@ -946,7 +946,7 @@ static int or1k_adv_jtag_write_memory(struct or1k_jtag *jtag_info,
        struct target *target = jtag_info->target;
        if ((target->endianness == TARGET_BIG_ENDIAN) && (size != 1)) {
                t = malloc(count * size * sizeof(uint8_t));
-               if (t == NULL) {
+               if (!t) {
                        LOG_ERROR("Out of memory");
                        return ERROR_FAIL;
                }