Skip to content

Commit

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

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

Reported-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230624174121.11508-13-philmd@linaro.org>
  • Loading branch information
philmd committed Jun 28, 2023
1 parent 2f642b1 commit 50830fe
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions target/i386/whpx/whpx-all.c
Expand Up @@ -2179,12 +2179,6 @@ int whpx_init_vcpu(CPUState *cpu)

vcpu = g_new0(struct whpx_vcpu, 1);

if (!vcpu) {
error_report("WHPX: Failed to allocte VCPU context.");
ret = -ENOMEM;
goto error;
}

hr = whp_dispatch.WHvEmulatorCreateEmulator(
&whpx_emu_callbacks,
&vcpu->emulator);
Expand Down

0 comments on commit 50830fe

Please sign in to comment.