aboutsummaryrefslogtreecommitdiff
path: root/hw/xen
diff options
context:
space:
mode:
authorEdgar E. Iglesias <edgar.iglesias@amd.com>2024-10-07 18:53:13 +0200
committerEdgar E. Iglesias <edgar.iglesias@amd.com>2024-10-21 07:53:21 +0200
commit676a68fd4850924db73548c9cb20ea484709708c (patch)
tree793748273010d023922f422b79f7515230295f57 /hw/xen
parentf1dd640896ee2b50cb34328f2568aad324702954 (diff)
downloadqemu-676a68fd4850924db73548c9cb20ea484709708c.zip
qemu-676a68fd4850924db73548c9cb20ea484709708c.tar.gz
qemu-676a68fd4850924db73548c9cb20ea484709708c.tar.bz2
hw/xen: Avoid use of uninitialized bufioreq_evtchn
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> Acked-by: Stefano Stabellini <sstabellini@kernel.org> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
Diffstat (limited to 'hw/xen')
-rw-r--r--hw/xen/xen-hvm-common.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/hw/xen/xen-hvm-common.c b/hw/xen/xen-hvm-common.c
index 7d2b728..7ffbbfe 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;
}