From: Richard Henderson <richard.henderson@linaro.org>
To: qemu-devel@nongnu.org
Subject: Re: [PATCH] hw/xen: Fix trace_xs_node_read() params
Date: Tue, 27 May 2025 08:22:05 +0100 [thread overview]
Message-ID: <a5ca62bb-9cfd-4ae4-be96-58e43bb53fe1@linaro.org> (raw)
In-Reply-To: <3a7386f9-a4ba-4268-a3fe-45c18360d878@linaro.org>
On 5/26/25 19:10, Philippe Mathieu-Daudé wrote:
> Alternatively, since this is an error path:
>
> -- >8 --
> diff --git a/hw/xen/xen-bus-helper.c b/hw/xen/xen-bus-helper.c
> index 288fad422be..1e49e60e147 100644
> --- a/hw/xen/xen-bus-helper.c
> +++ b/hw/xen/xen-bus-helper.c
> @@ -143,7 +143,8 @@ char *xs_node_read(struct qemu_xs_handle *h, xs_transaction_t tid,
> unsigned int *len, Error **errp,
> const char *path_fmt, ...)
> {
> - char *path, *value;
> + g_autofree char *value;
> + char *path;
> va_list ap;
>
> va_start(ap, path_fmt);
> @@ -151,12 +152,11 @@ char *xs_node_read(struct qemu_xs_handle *h, xs_transaction_t tid,
> va_end(ap);
>
> value = qemu_xen_xs_read(h, tid, path, len);
> - trace_xs_node_read(path, value);
> if (!value) {
> error_setg_errno(errp, errno, "failed to read from '%s'", path);
> + return NULL;
> }
Auto-free variables must be initialized.
r~
prev parent reply other threads:[~2025-05-27 7:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-23 16:01 [PATCH] hw/xen: Fix trace_xs_node_read() params Liam Merwick
2025-05-23 16:46 ` [EXTERNAL] " David Woodhouse
2025-05-26 16:19 ` Anthony PERARD
2025-05-26 18:10 ` Philippe Mathieu-Daudé
2025-05-27 7:22 ` Richard Henderson [this message]
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=a5ca62bb-9cfd-4ae4-be96-58e43bb53fe1@linaro.org \
--to=richard.henderson@linaro.org \
--cc=qemu-devel@nongnu.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.