From: Edgar E. Iglesias Date: Mon, 7 Oct 2024 16:53:13 +0000 (+0200) Subject: hw/xen: Avoid use of uninitialized bufioreq_evtchn X-Git-Tag: v9.2.0-rc0~41^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=676a68fd4850924db73548c9cb20ea484709708c;p=thirdparty%2Fqemu.git 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 Acked-by: Stefano Stabellini Signed-off-by: Edgar E. Iglesias --- diff --git a/hw/xen/xen-hvm-common.c b/hw/xen/xen-hvm-common.c index 7d2b72853b3..7ffbbfea23b 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; }