openocd: fix simple cases of NULL comparison
[fw/openocd] / src / target / etm.c
index 8555872ffd05086f502c6cfa36f7267faf5d6aaf..05577ead102e6a27ee667c9cb5558b7e97984dfe 100644 (file)
@@ -1808,7 +1808,7 @@ COMMAND_HANDLER(handle_etm_load_command)
                fileio_read_u32(file, &etm_ctx->trace_depth);
        }
        etm_ctx->trace_data = malloc(sizeof(struct etmv1_trace_data) * etm_ctx->trace_depth);
-       if (etm_ctx->trace_data == NULL) {
+       if (!etm_ctx->trace_data) {
                command_print(CMD, "not enough memory to perform operation");
                fileio_close(file);
                return ERROR_FAIL;