From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37169) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XihCR-0000Wk-JH for qemu-devel@nongnu.org; Mon, 27 Oct 2014 06:07:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XihCI-0003kQ-FX for qemu-devel@nongnu.org; Mon, 27 Oct 2014 06:06:55 -0400 Received: from mail-lb0-x22b.google.com ([2a00:1450:4010:c04::22b]:35365) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XihCI-0003jZ-8x for qemu-devel@nongnu.org; Mon, 27 Oct 2014 06:06:46 -0400 Received: by mail-lb0-f171.google.com with SMTP id z11so1952792lbi.2 for ; Mon, 27 Oct 2014 03:06:45 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <544E1931.8030209@redhat.com> Date: Mon, 27 Oct 2014 11:06:41 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1412204151-18117-1-git-send-email-jsnow@redhat.com> <1412204151-18117-6-git-send-email-jsnow@redhat.com> In-Reply-To: <1412204151-18117-6-git-send-email-jsnow@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 5/6] ide: Correct handling of malformed/short PRDTs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: John Snow , qemu-devel@nongnu.org Cc: kwolf@redhat.com, armbru@redhat.com, stefanha@redhat.com, mst@redhat.com 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; > }