Re: [PATCH] drivers: Conversions from kmalloc+memset to k(z|c)alloc.

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

 



On 7/19/06, Paul Mackerras <[email protected]> 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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux