Received: from eggs.gnu.org ([2001:4830:134:3::10]:48218) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZL9oD-0008D4-WB for qemu-devel@nongnu.org; Fri, 31 Jul 2015 08:53:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZL9oA-0001Cd-Qi for qemu-devel@nongnu.org; Fri, 31 Jul 2015 08:53:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52803) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZL9oA-0001CW-LW for qemu-devel@nongnu.org; Fri, 31 Jul 2015 08:53:06 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 42B84AC1D6 for ; Fri, 31 Jul 2015 12:53:06 +0000 (UTC) Date: Fri, 31 Jul 2015 14:53:03 +0200 From: Igor Mammedov Message-ID: <20150731145303.4bf5f2b6@nial.brq.redhat.com> In-Reply-To: <1438337675-13252-1-git-send-email-berrange@redhat.com> References: <1438337675-13252-1-git-send-email-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH for-2.4] acpi: avoid potential uninitialized access to cpu_hp_io_base List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" Cc: Paolo Bonzini , qemu-devel@nongnu.org, "Michael S. Tsirkin" On Fri, 31 Jul 2015 11:14:35 +0100 "Daniel P. Berrange" wrote: > When building QEMU with Mingw64 toolchain I see a warning > > CC x86_64-softmmu/hw/i386/acpi-build.o > hw/i386/acpi-build.c: In function 'acpi_build': > hw/i386/acpi-build.c:1138:9: warning: 'pm.cpu_hp_io_base' may be used uninitialized in this function [-Wmaybe-uninitialized] > aml_append(crs, > ^ > hw/i386/acpi-build.c:1666:16: note: 'pm.cpu_hp_io_base' was declared here > AcpiPmInfo pm; > ^ > > In acpi_get_pm_info() some of the fields are pre-initialized > to 0, but this one was missed. > > Signed-off-by: Daniel P. Berrange Impossible in practice since piix or lpc branches will initialize it, but there is no harm in making compiler happy. Reviewed-by: Igor Mammedov > --- > hw/i386/acpi-build.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c > index 46eddb8..95e0c65 100644 > --- a/hw/i386/acpi-build.c > +++ b/hw/i386/acpi-build.c > @@ -169,6 +169,7 @@ static void acpi_get_pm_info(AcpiPmInfo *pm) > Object *obj = NULL; > QObject *o; > > + pm->cpu_hp_io_base = 0; > pm->pcihp_io_base = 0; > pm->pcihp_io_len = 0; > if (piix) {