From nobody Thu Nov 26 11:42:54 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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=reject dis=none) header.from=nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1795526098; cv=none; d=zohomail.com; s=zohoarc; b=CLuz10m5PcTGAxhtX8HF7r/0Ytd3qQG4hxxASEXp/5iWNptMAWReFNTjdIfolSe8BgTIcoW23/KfjaZ6p+lQM1LZIy2iDvEkYOZCmuTfhlGdYDWVKm8d7Ny1gCj0UwfMQ++szh4LLm2s8KwJVSrRZx/y09jhH3Xd6x26eCwCyWk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1795526098; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:Sender:Subject:Subject:To:To:Message-Id; bh=m2R4iOMYtm2oPmLoyh9ZHfeC6irrRhDWQp/IKMlUqmI=; b=khGT/12arbwOM9GoRwyAPchEgv4vlfUlsQIeyzGH5fkN64VVc313dg1ZFuO6veCWY9m1xt/DNoviGQcKxsgsAW7hT7HNQzCKrzuYhbY3Dyb9Ljw0AvUbk/nRXPKXJx867nPEYiVc9rqUkfma5y1G974YSQnVXoUUJaeZhEIf104= ARC-Authentication-Results: i=1; mx.zohomail.com; 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=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1795526098382217.62778106482074; Tue, 24 Nov 2026 05:14:58 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xVqLs-0007aX-MJ; Tue, 24 Nov 2026 08:14:28 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xVouI-0003De-DO for qemu-devel@nongnu.org; Tue, 24 Nov 2026 06:41:54 -0500 Received: from na1pdmzitismtp02.tibco.com ([160.101.131.9]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xVouG-0007dc-UF for qemu-devel@nongnu.org; Tue, 24 Nov 2026 06:41:54 -0500 Received: from mewpvdipd1100.citrite.net (unknown [10.113.40.46]) by na1pdmzitismtp02.tibco.com (Postfix) with ESMTP id 86D8B84E0BB6; Tue, 24 Nov 2026 06:40:13 -0500 (EST) To: qemu-devel@nongnu.org Cc: Alex Brett , Stefano Stabellini , Anthony PERARD , "Edgar E. Iglesias" , xen-devel@lists.xenproject.org Subject: [PATCH] xen-mapcache: Fix a build error with -fexceptions Date: Tue, 24 Nov 2026 11:41:26 +0000 Message-ID: <20261124114127.790173-1-alex.brett@citrix.com> X-Mailer: git-send-email 2.53.0 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=lists1p.gnu.org; Received-SPF: pass client-ip=160.101.131.9; envelope-from=alex.brett@citrix.com; helo=na1pdmzitismtp02.tibco.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Tue, 24 Nov 2026 08:14:27 -0500 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Alex Brett From: Alex Brett via qemu development Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1795526101315047900 Content-Type: text/plain; charset="utf-8" When building with -Werror=3Dmaybe-uninitialized and -fexceptions, gcc can report: error: 'err' may be used uninitialized [-Werror=3Dmaybe-uninitialized] err gets assigned to g_new0() unconditionally, but under -fexceptions the calls to trace_xen_remap_bucket() or g_new0() might unwind, leading the g_autofree cleanup to run g_free() on an uninitialised err. Avoid the warning and any future issues by initialising it to NULL in the same pattern as other definitions. Signed-off-by: Alex Brett Reviewed-by: Peter Maydell --- hw/xen/xen-mapcache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xen/xen-mapcache.c b/hw/xen/xen-mapcache.c index e30c07c2ee..0a19cfdc1b 100644 --- a/hw/xen/xen-mapcache.c +++ b/hw/xen/xen-mapcache.c @@ -199,7 +199,7 @@ static void xen_remap_bucket(MapCache *mc, uint8_t *vaddr_base; g_autofree uint32_t *refs =3D NULL; g_autofree xen_pfn_t *pfns =3D NULL; - g_autofree int *err; + g_autofree int *err =3D NULL; unsigned int i; hwaddr nb_pfn =3D size >> XC_PAGE_SHIFT; =20 --=20 2.53.0