[PATCH] use kzalloc and kcalloc in core fs code

Signed-off-by: Oliver Neukum <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
Oliver Neukum 2006-03-25 03:08:13 -08:00 • committed by Linus Torvalds
commit 11b0b5abb2
8 changed files with 10 additions and 22 deletions

View file

@ -122,10 +122,9 @@ static int aio_setup_ring(struct kioctx *ctx)
info->nr = 0;
info->ring_pages = info->internal_pages;
if (nr_pages > AIO_RING_PAGES) {
info->ring_pages = kmalloc(sizeof(struct page *) * nr_pages, GFP_KERNEL);
info->ring_pages = kcalloc(nr_pages, sizeof(struct page *), GFP_KERNEL);
if (!info->ring_pages)
return -ENOMEM;
memset(info->ring_pages, 0, sizeof(struct page *) * nr_pages);
}
info->mmap_size = nr_pages * PAGE_SIZE;