From: "Philippe Mathieu-Daudé" <philippe.mathieu.daude@gmail.com>
To: qemu-devel@nongnu.org
Cc: "Philippe Mathieu-Daudé" <f4bug@amsat.org>,
"Cameron Esfahani" <dirty@apple.com>,
"Roman Bolshakov" <r.bolshakov@yadro.com>,
"Igor Mammedov" <imammedo@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>
Subject: [PATCH-for-7.0] target/i386/hvf: Free ressources when vCPU is destroyed
Date: Tue, 22 Mar 2022 20:07:45 +0100 [thread overview]
Message-ID: <20220322190745.37727-1-philippe.mathieu.daude@gmail.com> (raw)
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)
--
2.35.1
next reply other threads:[~2022-03-22 19:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-22 19:07 Philippe Mathieu-Daudé [this message]
2022-03-23 16:37 ` [PATCH-for-7.0] target/i386/hvf: Free ressources when vCPU is destroyed Philippe Mathieu-Daudé
2022-03-24 8:25 ` Igor Mammedov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220322190745.37727-1-philippe.mathieu.daude@gmail.com \
--to=philippe.mathieu.daude@gmail.com \
--cc=dirty@apple.com \
--cc=f4bug@amsat.org \
--cc=imammedo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=r.bolshakov@yadro.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).