From nobody Sun Dec 22 11:01:04 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1728335856; cv=none; d=zohomail.com; s=zohoarc; b=oDm1qPWRnL1n5Aq6al2RaWW52mE6KXqPft7MXHov/m7TNmAx8iXTgZ0GWU14JDfG2I4N8lwUcMqGG1rtkOr7iUWgtPyNvyh/WN7Jq6YWsC7Dfy4cvigW3oefTUIwu6bbAlklwXmI3bxt9gcsNIkPzOe8OVUPSfHov6oNBVqRFHw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728335856; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=nOZFp0KYwy2xarbmigXeGI5Kh1b1KEGSJbQb+7v41UY=; b=ZUU9gkwf/J8hHF3Z9KVQppvjgdmqxGT2a9vJcdutFCwmOhm5f9GZ/BKaL5iaQmQLUjIAlgcpe81/wmIJ69IiICl7ecoS0u/F7SWNFdtQ4d5ikDZ5WqUj143OQhv5JbWtynTsxCazYZrIRM9G8spmsWKVzztw+gsMst1pN5PArqk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1728335856174770.1668168077608; Mon, 7 Oct 2024 14:17:36 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sxv6Z-0008FP-P4; Mon, 07 Oct 2024 17:17:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sxv65-0007td-90 for qemu-devel@nongnu.org; Mon, 07 Oct 2024 17:16:53 -0400 Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sxv63-00011d-Qm for qemu-devel@nongnu.org; Mon, 07 Oct 2024 17:16:53 -0400 Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-53995380bb3so5905934e87.1 for ; Mon, 07 Oct 2024 14:16:51 -0700 (PDT) Received: from gmail.com (213-67-3-247-no600.tbcn.telia.com. [213.67.3.247]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-539aff1d214sm945051e87.132.2024.10.07.14.16.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Oct 2024 14:16:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728335809; x=1728940609; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=nOZFp0KYwy2xarbmigXeGI5Kh1b1KEGSJbQb+7v41UY=; b=gQAzmsg9g7LZDrkrbd2hE6BiC1GJj1HOt87LQMUrMh5eKb0o/KMA4PKIIdkfSfYqCn +gqnnpou39Rkvn/Ow4C/O5o5iUkZhTGrA1Tdxe+l6kVZcD3Ghiv5xaTOX++BAlcAOvAU goj4xxwgWLNtJgV6vgz8ETzd+E1i7x6z3K3x3OCrDIMRQdCuI2+mS5UulEsc4ea35N2O E/UPD0mpviWDk3v8sOYh5zyYlJ0cqu05oxcsVzhgRfLlrtRhaYAeiwtg1VeVDgIRbQyU SktJMv+SG5mhJH0R1EvetHLUEm/s3GB/x1+54FWGDNuxYyU1y0u/Uf7Uul4xCdNYfler VzSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728335809; x=1728940609; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nOZFp0KYwy2xarbmigXeGI5Kh1b1KEGSJbQb+7v41UY=; b=R99oIoMZYMP4dyLgCphRxq/ySQPem2VC1Tq3qT9HRPNzex0/y3ksnNSLvVKeM1CoUT avUef8Zvylk0Qe96Zl8dAeIsDhJv3OaMtoVTgVKXFt5eOQ8SrFh9cruNwuoYXRPv86Mn 4ek69R4WwCLi8fHchfiyY9KNSSIkb1KGmiGWxTolcphbPY+6V7Q+VjhK5snD7l+HJMLJ TW+hh3GP/1bWEvugrz6xB9pq3YEnjKXDYy6X+8hFTHr33h3GfvoxuG9uPEL2WKgTVPAh /E84Jdo5LSlTh386a8rzTE6tgWSRhmzoksyhsQgm2N4MwTch+ZvMchul0MY8wmwp/b4a ibFA== X-Gm-Message-State: AOJu0YzC38bu7Tj3jUMdpsGMKL3IwCcCRaaq1dVaDXtoze6yYR/9ygPc 8OqOpvlFbh3OS0apZb/5uWGk+PUo1MBcv+0n8wXSaiKFSgj9UgQLbr9/2Ith X-Google-Smtp-Source: AGHT+IEDn3064h8cU2IDaRl8of4yOaXKWQsj91WD4UsSn5HTEcpmp2TwGmNka3Rpk/B+XuSHazDZAQ== X-Received: by 2002:a05:6512:304b:b0:539:93b2:1383 with SMTP id 2adb3069b0e04-539ab9e1738mr6600333e87.46.1728335808875; Mon, 07 Oct 2024 14:16:48 -0700 (PDT) From: "Edgar E. Iglesias" 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" Subject: [PATCH v1 1/1] hw/xen: Avoid use of uninitialized bufioreq_evtchn Date: Mon, 7 Oct 2024 23:16:42 +0200 Message-ID: <20241007211643.1572271-2-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241007211643.1572271-1-edgar.iglesias@gmail.com> References: <20241007211643.1572271-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::12b; envelope-from=edgar.iglesias@gmail.com; helo=mail-lf1-x12b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1728335856667116600 Content-Type: text/plain; charset="utf-8" From: "Edgar E. Iglesias" Avoid use of uninitialized bufioreq_evtchn. It should only be used if buffered IOREQs are enabled. Resolves: Coverity CID 1563383 Reported-by: Peter Maydell Signed-off-by: Edgar E. Iglesias Acked-by: Stefano Stabellini --- 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; } =20 - trace_xen_map_ioreq_server_buffered_io_evtchn(bufioreq_evtchn); - - state->bufioreq_remote_port =3D bufioreq_evtchn; + if (state->has_bufioreq) { + trace_xen_map_ioreq_server_buffered_io_evtchn(bufioreq_evtchn); + state->bufioreq_remote_port =3D bufioreq_evtchn; + } =20 return 0; } --=20 2.43.0