qemu-trivial
[Top][All Lists]
Advanced

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

Re: [Qemu-trivial] [Qemu-devel] [PATCH 1/5] hw/dma/pxa2xx: Remove superf


From: Thomas Huth
Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCH 1/5] hw/dma/pxa2xx: Remove superfluous memset
Date: Fri, 9 Oct 2015 08:39:22 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 08/10/15 22:59, Eric Blake wrote:
> On 10/08/2015 01:35 PM, Thomas Huth wrote:
>> g_malloc0 already clears the memory, so no need for
>> the additional memset here.
>>
>> Signed-off-by: Thomas Huth <address@hidden>
>> ---
>>  hw/dma/pxa2xx_dma.c | 1 -
>>  1 file changed, 1 deletion(-)
>>
>> diff --git a/hw/dma/pxa2xx_dma.c b/hw/dma/pxa2xx_dma.c
>> index d4501fb..3f0a720 100644
>> --- a/hw/dma/pxa2xx_dma.c
>> +++ b/hw/dma/pxa2xx_dma.c
>> @@ -461,7 +461,6 @@ static int pxa2xx_dma_init(SysBusDevice *sbd)
>>  
>>      s->chan = g_malloc0(sizeof(PXA2xxDMAChannel) * s->channels);
> 
> As long as we're here, this should probably be switched to g_new0(), in
> part to avoid any chance that the multiply can overflow.

Ok, I doubt that we really get overflows here, but g_new0 is certainly
nicer here, so I'll change my patch accordingly.

 Thomas


Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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