From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: Jan Beulich <jbeulich@suse.com>,
"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Anthony PERARD <anthony.perard@vates.tech>
Subject: Re: [PATCH] xl: properly dispose of vTPM struct instance
Date: Tue, 14 Jan 2025 12:25:08 +0100 [thread overview]
Message-ID: <652d7978-8810-4e10-9a19-e067948a223f@gmail.com> (raw)
In-Reply-To: <73a01ddf-6090-4fda-a8c0-5703e7c9e81b@suse.com>
On 1/14/25 9:13 AM, Jan Beulich wrote:
> The backend_domname field requires separate freeing; make sure to call
> libxl_device_vtpm_dispose() also on respective error paths.
>
> Coverity-ID: 1638719
> Fixes: dde22055ac3a ("libxl: add vtpm support")
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
R-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Thanks.
~ Oleksii
>
> --- a/tools/xl/xl_vtpm.c
> +++ b/tools/xl/xl_vtpm.c
> @@ -44,12 +44,14 @@ int main_vtpmattach(int argc, char **arg
> if (MATCH_OPTION("uuid", *argv, oparg)) {
> if(libxl_uuid_from_string(&(vtpm.uuid), oparg)) {
> fprintf(stderr, "Invalid uuid specified (%s)\n", oparg);
> + libxl_device_vtpm_dispose(&vtpm);
> return 1;
> }
> } else if (MATCH_OPTION("backend", *argv, oparg)) {
> replace_string(&vtpm.backend_domname, oparg);
> } else {
> fprintf(stderr, "unrecognized argument `%s'\n", *argv);
> + libxl_device_vtpm_dispose(&vtpm);
> return 1;
> }
> }
> @@ -65,6 +67,7 @@ int main_vtpmattach(int argc, char **arg
>
> if (libxl_device_vtpm_add(ctx, domid, &vtpm, 0)) {
> fprintf(stderr, "libxl_device_vtpm_add failed.\n");
> + libxl_device_vtpm_dispose(&vtpm);
> return 1;
> }
> libxl_device_vtpm_dispose(&vtpm);
next prev parent reply other threads:[~2025-01-14 11:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-14 8:13 [PATCH] xl: properly dispose of vTPM struct instance Jan Beulich
2025-01-14 9:28 ` Andrew Cooper
2025-01-14 11:25 ` Oleksii Kurochko [this message]
2025-01-16 13:12 ` Anthony PERARD
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=652d7978-8810-4e10-9a19-e067948a223f@gmail.com \
--to=oleksii.kurochko@gmail.com \
--cc=anthony.perard@vates.tech \
--cc=jbeulich@suse.com \
--cc=xen-devel@lists.xenproject.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.