target/i386/hvf: Free ressources when vCPU is destroyed
From: Philippe Mathieu-Daudé <[email protected]>
Both xsave_buf and hvf_caps are allocated in hvf_arch_init_vcpu(), free them in hvf_arch_vcpu_destroy().
Reported-by Mark Kanda <[email protected]>
Suggested-by Igor Mammedov <[email protected]>
Signed-off-by Philippe Mathieu-Daudé <[email protected]>
--- target/i386/hvf/hvf.c | 2 ++ 1 file changed, 2 insertions(+)
target/i386/hvf/hvf.c +2 -0
@@ -163,7 +163,9 @@ void hvf_arch_vcpu_destroy(CPUState *cpu)X86CPU *x86_cpu =X86_CPU (cpu);CPUX86State *env = &x86_cpu->env; +g_free (env->xsave_buf);g_free (env->hvf_mmio_buf); +g_free (hvf_state->hvf_caps); }static void init_tsc_freq (CPUX86State *env)
Signature · 1 line
2.35.1
Typo s/ressources/resources/ in subject.
Quoted 26 lines · Philippe Mathieu-Daudé
From: Philippe Mathieu-Daudé <[email protected]>
Both
xsave_bufandhvf_capsare allocated inhvf_arch_init_vcpu(), free them inhvf_arch_vcpu_destroy().Reported-by Mark Kanda <[email protected]>Suggested-by Igor Mammedov <[email protected]>Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/i386/hvf/hvf.c | 2 ++ 1 file changed, 2 insertions(+)target/i386/hvf/hvf.c +2
-0@@ -163,7 +163,9 @@ void hvf_arch_vcpu_destroy(CPUState *cpu)X86CPU *x86_cpu =X86_CPU (cpu);CPUX86State *env = &x86_cpu->env; +g_free (env->xsave_buf);g_free (env->hvf_mmio_buf); +g_free (hvf_state->hvf_caps); }static void init_tsc_freq (CPUX86State *env)
Igor Mammedov
Reviewed-byQuoted 8 lines · On Tue, 22 Mar 2022 20:07:45 +0100 Philippe Mathieu-Daudé…
From: Philippe Mathieu-Daudé <[email protected]>
Both
xsave_bufandhvf_capsare allocated inhvf_arch_init_vcpu(), free them inhvf_arch_vcpu_destroy().Reported-by Mark Kanda <[email protected]>Suggested-by Igor Mammedov <[email protected]>Signed-off-by Philippe Mathieu-Daudé <[email protected]>
Reviewed-by Igor Mammedov <[email protected]>
Quoted 18 lines
--- target/i386/hvf/hvf.c | 2 ++ 1 file changed, 2 insertions(+)target/i386/hvf/hvf.c +2
-0@@ -163,7 +163,9 @@ void hvf_arch_vcpu_destroy(CPUState *cpu)X86CPU *x86_cpu =X86_CPU (cpu);CPUX86State *env = &x86_cpu->env; +g_free (env->xsave_buf);g_free (env->hvf_mmio_buf); +g_free (hvf_state->hvf_caps); }static void init_tsc_freq (CPUX86State *env)