qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH-for-7.0] target/i386/hvf: Free ressources when vCPU is destro


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH-for-7.0] target/i386/hvf: Free ressources when vCPU is destroyed
Date: Wed, 23 Mar 2022 17:37:57 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.7.0

Typo s/ressources/resources/ in subject.

On 22/3/22 20:07, Philippe Mathieu-Daudé wrote:
From: Philippe Mathieu-Daudé <f4bug@amsat.org>

Both xsave_buf and hvf_caps are allocated in hvf_arch_init_vcpu(),
free them in hvf_arch_vcpu_destroy().

Reported-by: Mark Kanda <mark.kanda@oracle.com>
Suggested-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
  target/i386/hvf/hvf.c | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/target/i386/hvf/hvf.c b/target/i386/hvf/hvf.c
index fc12c02fb2..39fa4641b9 100644
--- a/target/i386/hvf/hvf.c
+++ b/target/i386/hvf/hvf.c
@@ -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)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]