From: Igor Mammedov <imammedo@redhat.com>
To: "Daniel P. Berrange" <berrange@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
qemu-devel@nongnu.org, "Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [Qemu-devel] [PATCH for-2.4] acpi: avoid potential uninitialized access to cpu_hp_io_base
Date: Fri, 31 Jul 2015 14:53:03 +0200 [thread overview]
Message-ID: <20150731145303.4bf5f2b6@nial.brq.redhat.com> (raw)
In-Reply-To: <1438337675-13252-1-git-send-email-berrange@redhat.com>
On Fri, 31 Jul 2015 11:14:35 +0100
"Daniel P. Berrange" <berrange@redhat.com> 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 <berrange@redhat.com>
Impossible in practice since piix or lpc branches will initialize it,
but there is no harm in making compiler happy.
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
> ---
> 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) {
prev parent reply other threads:[~2015-07-31 12:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-31 10:14 [Qemu-devel] [PATCH for-2.4] acpi: avoid potential uninitialized access to cpu_hp_io_base Daniel P. Berrange
2015-07-31 12:53 ` Igor Mammedov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150731145303.4bf5f2b6@nial.brq.redhat.com \
--to=imammedo@redhat.com \
--cc=berrange@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).