Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
accel: Remove NVMM unreachable error path
g_malloc0() can not fail. Remove the unreachable error path.

https://developer-old.gnome.org/glib/stable/glib-Memory-Allocation.html#glib-Memory-Allocation.description

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230624174121.11508-10-philmd@linaro.org>
  • Loading branch information
philmd committed Jun 28, 2023
1 parent 642ce52 commit 8c12c76
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions target/i386/nvmm/nvmm-all.c
Expand Up @@ -943,10 +943,6 @@ nvmm_init_vcpu(CPUState *cpu)
}

qcpu = g_malloc0(sizeof(*qcpu));
if (qcpu == NULL) {
error_report("NVMM: Failed to allocate VCPU context.");
return -ENOMEM;
}

ret = nvmm_vcpu_create(mach, cpu->cpu_index, &qcpu->vcpu);
if (ret == -1) {
Expand Down

0 comments on commit 8c12c76

Please sign in to comment.