[PATCH] drivers: Conversions from kmalloc+memset to k(z|c)alloc.
Pekka Enberg
penberg at cs.helsinki.fi
Wed Jul 19 09:53:58 EDT 2006
On 7/19/06, Paul Mackerras <paulus at samba.org> wrote:
> > - par->mmap_map = kmalloc(j * sizeof(*par->mmap_map), GFP_ATOMIC);
> > + par->mmap_map = kcalloc(j, sizeof(*par->mmap_map), GFP_ATOMIC);
> > if (!par->mmap_map) {
> > PRINTKE("atyfb_setup_sparc() can't alloc mmap_map\n");
> > return -ENOMEM;
> > }
> > - memset(par->mmap_map, 0, j * sizeof(*par->mmap_map));
>
> What exactly do we gain by using kcalloc rather than kzalloc here?
> There is no potential overflow issue to worry about.
Potentially useful for kmemleak, I think. Catalin?
Pekka
More information about the linux-pcmcia
mailing list