[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <84144f020607190653r5fb8b220g7d183ca79e95eff2@mail.gmail.com>
Date: Wed, 19 Jul 2006 16:53:58 +0300
From: "Pekka Enberg" <penberg@...helsinki.fi>
To: "Paul Mackerras" <paulus@...ba.org>
Cc: "Panagiotis Issaris" <takis@...umba.uhasselt.be>,
linux-kernel@...r.kernel.org, len.brown@...el.com,
chas@....nrl.navy.mil, miquel@...uba.ar, kkeil@...e.de,
benh@...nel.crashing.org, video4linux-list@...hat.com,
rmk+mmc@....linux.org.uk, Neela.Kolli@...enio.com,
jgarzik@...ox.com, vandrove@...cvut.cz, adaplas@....net,
thomas@...ischhofer.net, weissg@...nna.at, philb@....org,
linux-pcmcia@...ts.infradead.org, jkmaline@...hut.fi,
catalin.marinas@...il.com
Subject: Re: [PATCH] drivers: Conversions from kmalloc+memset to k(z|c)alloc.
On 7/19/06, Paul Mackerras <paulus@...ba.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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists