From: Stefano Stabellini <sstabellini@kernel.org>
To: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
Cc: qemu-devel@nongnu.org, sstabellini@kernel.org,
anthony@xenproject.org, paul@xen.org, peter.maydell@linaro.org,
edgar.iglesias@amd.com, xen-devel@lists.xenproject.org
Subject: Re: [PATCH v1 1/1] hw/xen: Avoid use of uninitialized bufioreq_evtchn
Date: Mon, 7 Oct 2024 14:38:18 -0700 (PDT) [thread overview]
Message-ID: <alpine.DEB.2.22.394.2410071438110.3512606@ubuntu-linux-20-04-desktop> (raw)
In-Reply-To: <20241007211643.1572271-2-edgar.iglesias@gmail.com>
On Mon, 7 Oct 2024, Edgar E. Iglesias wrote:
> From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>
>
> Avoid use of uninitialized bufioreq_evtchn. It should only
> be used if buffered IOREQs are enabled.
>
> Resolves: Coverity CID 1563383
> Reported-by: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
> ---
> hw/xen/xen-hvm-common.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/hw/xen/xen-hvm-common.c b/hw/xen/xen-hvm-common.c
> index 7d2b72853b..7ffbbfea23 100644
> --- a/hw/xen/xen-hvm-common.c
> +++ b/hw/xen/xen-hvm-common.c
> @@ -752,9 +752,10 @@ static int xen_map_ioreq_server(XenIOState *state)
> return -1;
> }
>
> - trace_xen_map_ioreq_server_buffered_io_evtchn(bufioreq_evtchn);
> -
> - state->bufioreq_remote_port = bufioreq_evtchn;
> + if (state->has_bufioreq) {
> + trace_xen_map_ioreq_server_buffered_io_evtchn(bufioreq_evtchn);
> + state->bufioreq_remote_port = bufioreq_evtchn;
> + }
>
> return 0;
> }
> --
> 2.43.0
>
prev parent reply other threads:[~2024-10-07 21:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-07 21:16 [PATCH v1 0/1] hw/xen: Avoid Avoid use of uninitialized bufioreq_evtchn Edgar E. Iglesias
2024-10-07 21:16 ` [PATCH v1 1/1] hw/xen: " Edgar E. Iglesias
2024-10-07 21:38 ` Stefano Stabellini [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=alpine.DEB.2.22.394.2410071438110.3512606@ubuntu-linux-20-04-desktop \
--to=sstabellini@kernel.org \
--cc=anthony@xenproject.org \
--cc=edgar.iglesias@amd.com \
--cc=edgar.iglesias@gmail.com \
--cc=paul@xen.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--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 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).