From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: qemu-devel@nongnu.org
Cc: sstabellini@kernel.org, anthony@xenproject.org, paul@xen.org,
peter.maydell@linaro.org, edgar.iglesias@amd.com,
xen-devel@lists.xenproject.org,
"Edgar E. Iglesias" <edgar.iglesias@gmail.com>
Subject: [PATCH v1 1/1] hw/xen: Avoid use of uninitialized bufioreq_evtchn
Date: Mon, 7 Oct 2024 23:16:42 +0200 [thread overview]
Message-ID: <20241007211643.1572271-2-edgar.iglesias@gmail.com> (raw)
In-Reply-To: <20241007211643.1572271-1-edgar.iglesias@gmail.com>
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>
---
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
next prev parent reply other threads:[~2024-10-07 21:17 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 ` Edgar E. Iglesias [this message]
2024-10-07 21:38 ` [PATCH v1 1/1] hw/xen: " Stefano Stabellini
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=20241007211643.1572271-2-edgar.iglesias@gmail.com \
--to=edgar.iglesias@gmail.com \
--cc=anthony@xenproject.org \
--cc=edgar.iglesias@amd.com \
--cc=paul@xen.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=sstabellini@kernel.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).