From: Kevin Wolf <kwolf@redhat.com>
To: "Andreas Färber" <afaerber@suse.de>
Cc: marcandre.lureau@gmail.com, Gerd Hoffmann <kraxel@redhat.com>,
qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] intel-hda: fix stream search
Date: Wed, 02 Nov 2011 13:24:41 +0100 [thread overview]
Message-ID: <4EB13689.1050902@redhat.com> (raw)
In-Reply-To: <4EB13516.1060801@suse.de>
Am 02.11.2011 13:18, schrieb Andreas Färber:
> Am 02.11.2011 12:56, schrieb Gerd Hoffmann:
>> commit ba43d28916c4f51c19bd7366089155ce81bee058 introduces a bug:
>> The stream-not-found case doesn't error out any more, instead the
>> code silently uses the first stream. Fix it.
>>
>> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
>> ---
>> hw/intel-hda.c | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/hw/intel-hda.c b/hw/intel-hda.c
>> index 675b659..b7ec36d 100644
>> --- a/hw/intel-hda.c
>> +++ b/hw/intel-hda.c
>> @@ -401,7 +401,7 @@ static bool intel_hda_xfer(HDACodecDevice *dev, uint32_t stnr, bool output,
>> break;
>> }
>> }
>> - if (st == NULL) {
>> + if (s == 4) {
>> return false;
>> }
>> if (st->bpl == NULL) {
>
> The commit message doesn't say it clearly: Is st == NULL impossible?
> If not, this introduces a potential NULL pointer dereference at st->bpl.
Yes, it's impossible. This is the full context:
st = output ? d->st + 4 : d->st;
for (s = 0; s < 4; s++) {
if (stnr == ((st[s].ctl >> 20) & 0x0f)) {
st = st + s;
break;
}
}
d->st is an array: IntelHDAStream st[8];
Kevin
next prev parent reply other threads:[~2011-11-02 12:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-02 11:56 [Qemu-devel] [PATCH] intel-hda: fix stream search Gerd Hoffmann
2011-11-02 12:12 ` Markus Armbruster
2011-11-02 12:18 ` Andreas Färber
2011-11-02 12:24 ` Kevin Wolf [this message]
2011-11-02 12:55 ` Anthony Liguori
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=4EB13689.1050902@redhat.com \
--to=kwolf@redhat.com \
--cc=afaerber@suse.de \
--cc=kraxel@redhat.com \
--cc=marcandre.lureau@gmail.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).