acpi: avoid potential uninitialized access to cpu_hp_io_base
authorDaniel P. Berrange <berrange@redhat.com>
Fri, 31 Jul 2015 10:14:35 +0000 (11:14 +0100)
committerSeokYeon Hwang <syeon.hwang@samsung.com>
Sun, 30 Aug 2015 08:45:41 +0000 (17:45 +0900)
commitbe75f45d1a178bd7c84edff319dabc0873e90d2a
tree676a56c5f502098c103552013c1e1edb28a0dabe
parent2fcb10ec7d4fbda1855421f5eb1a6ab3266cd50f
acpi: avoid potential uninitialized access to cpu_hp_io_base

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.

Change-Id: If97318a12da70f9c5dc951e938897d21d57a2d77
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
hw/i386/acpi-build.c