qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 5/6] ide: Correct handling of malformed/short PR


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 5/6] ide: Correct handling of malformed/short PRDTs
Date: Mon, 27 Oct 2014 11:06:41 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0


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;
>  }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]