From: Paolo Bonzini <pbonzini@redhat.com>
To: "Christian Borntraeger" <borntraeger@de.ibm.com>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>,
qemu-devel@nongnu.org
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [PATCH for 6.0 v3] hw/intc/i8259: Refactor pic_read_irq() to avoid uninitialized variable
Date: Thu, 18 Mar 2021 18:34:16 +0100 [thread overview]
Message-ID: <32a0250b-6d09-e092-af22-939fd5295cf6@redhat.com> (raw)
In-Reply-To: <e48ce6e7-74bf-f105-4962-b124974712e5@de.ibm.com>
On 18/03/21 17:34, Christian Borntraeger wrote:
>> Some compiler versions are smart enough to detect a potentially
>> uninitialized variable, but are not smart enough to detect that this
>> cannot happen due to the code flow:
>>
>> ../hw/intc/i8259.c: In function ‘pic_read_irq’:
>> ../hw/intc/i8259.c:203:13: error: ‘irq2’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
>> 203 | irq = irq2 + 8;
>> | ~~~~^~~~~~~~~~
>>
>> Restrict irq2 variable use to the inner statement.
>>
>> Fixes: 78ef2b6989f ("i8259: Reorder intack in pic_read_irq")
>> Reported-by: Christian Borntraeger <borntraeger@de.ibm.com>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> Tested-by: Christian Borntraeger <borntraeger@de.ibm.com>
Queued, thanks to both.
prev parent reply other threads:[~2021-03-18 17:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-18 16:30 [PATCH for 6.0 v3] hw/intc/i8259: Refactor pic_read_irq() to avoid uninitialized variable Philippe Mathieu-Daudé
2021-03-18 16:34 ` Christian Borntraeger
2021-03-18 17:34 ` Paolo Bonzini [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=32a0250b-6d09-e092-af22-939fd5295cf6@redhat.com \
--to=pbonzini@redhat.com \
--cc=borntraeger@de.ibm.com \
--cc=mst@redhat.com \
--cc=philmd@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).