qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: John Snow <jsnow@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel@nongnu.org
Cc: kwolf@redhat.com, armbru@redhat.com, stefanha@redhat.com, mst@redhat.com
Subject: Re: [Qemu-devel] [PATCH 5/6] ide: Correct handling of malformed/short PRDTs
Date: Mon, 27 Oct 2014 14:30:36 -0400	[thread overview]
Message-ID: <544E8F4C.1000303@redhat.com> (raw)
In-Reply-To: <544E1931.8030209@redhat.com>



On 10/27/2014 06:06 AM, Paolo Bonzini wrote:
>
>
> On 10/02/2014 12:55 AM, John Snow wrote:
>> +    /* If this is true, you're leaking memory. */
>
> ... or qsg is uninitialized, which would work because qemu_sglist_init
> initializes all fields.
>
> This is the only comment I have on the series. :)
>
> Paolo
>
>> +    assert(qsg->sg == NULL);
>> +
>>       qsg->sg = g_malloc(alloc_hint * sizeof(ScatterGatherEntry));
>
>>
>> @@ -1147,7 +1147,7 @@ static int ahci_dma_prepare_buf(IDEDMA *dma, int is_write)
>>       s->io_buffer_size = s->sg.size;
>>
>>       DPRINTF(ad->port_no, "len=%#x\n", s->io_buffer_size);
>> -    return s->io_buffer_size != 0;
>> +    return s->io_buffer_size / 512 != 0;
>>   }

oh, yeah :\

I really did want to guard against re-initialization, but if it's 
expected that this structure may have completely anything in it at init 
time, I don't really have a way to do that, do I.

I guess I'll just delete the assertion, unless you have a very simple 
idea to help guard against double-inits.

--j

  reply	other threads:[~2014-10-27 18:30 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-01 22:55 [Qemu-devel] [PATCH 0/6] AHCI Device Fixes John Snow
2014-10-01 22:55 ` [Qemu-devel] [PATCH 1/6] ahci: Correct PIO/D2H FIS responses John Snow
2014-10-27  9:32   ` Markus Armbruster
2014-10-27 15:43     ` John Snow
2014-10-27 15:59       ` Markus Armbruster
2014-10-01 22:55 ` [Qemu-devel] [PATCH 2/6] ahci: Update byte count after DMA completion John Snow
2014-10-01 22:55 ` [Qemu-devel] [PATCH 3/6] ide: repair PIO transfers for cases where nsector > 1 John Snow
2014-10-01 22:55 ` [Qemu-devel] [PATCH 4/6] ahci: unify sglist preparation John Snow
2014-10-01 22:55 ` [Qemu-devel] [PATCH 5/6] ide: Correct handling of malformed/short PRDTs John Snow
2014-10-27 10:06   ` Paolo Bonzini
2014-10-27 18:30     ` John Snow [this message]
2014-10-01 22:55 ` [Qemu-devel] [PATCH 6/6] ahci: Fix SDB FIS Construction John Snow
2014-10-16  9:36 ` [Qemu-devel] [PATCH 0/6] AHCI Device Fixes John Snow
2014-10-25 20:03 ` Michael S. Tsirkin
2014-10-27 10:07 ` Paolo Bonzini
2014-10-28 13:51 ` Stefan Hajnoczi
2014-10-28 23:54   ` John Snow
2014-10-29  0:03     ` Paolo Bonzini
2014-10-29  0:06       ` John Snow
2014-10-29  0:27         ` Paolo Bonzini
2014-10-29  1:28           ` John Snow
2014-10-29  8:58             ` Paolo Bonzini
2014-10-30 10:52             ` Stefan Hajnoczi

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=544E8F4C.1000303@redhat.com \
    --to=jsnow@redhat.com \
    --cc=armbru@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /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).