Message ID | 20230622160823.71851-13-philmd@linaro.org (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | accel: Share CPUState accel context (HAX/NVMM/WHPX/HVF) | expand |
On 6/22/23 18:08, Philippe Mathieu-Daudé wrote: > 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> > --- > target/i386/whpx/whpx-all.c | 6 ------ > 1 file changed, 6 deletions(-) Reviewed-by: Richard Henderson <richard.henderson@linaro.org> r~
diff --git a/target/i386/whpx/whpx-all.c b/target/i386/whpx/whpx-all.c index 340053e6dd..012ba696a9 100644 --- a/target/i386/whpx/whpx-all.c +++ b/target/i386/whpx/whpx-all.c @@ -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);
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> --- target/i386/whpx/whpx-all.c | 6 ------ 1 file changed, 6 deletions(-)