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 <th...@redhat.com> > --- > 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. > > - memset(s->chan, 0, sizeof(PXA2xxDMAChannel) * s->channels); But this part is correct. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature