diff options
author | Oliver Neukum <neukum@fachschaft.cup.uni-muenchen.de> | 2006-03-25 12:08:13 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-25 17:23:00 +0100 |
commit | 11b0b5abb2097a63c1081d9b7e825b987b227972 (patch) | |
tree | 162c828c8d807a1b30869acbe11682dc9222dc16 /fs/bio.c | |
parent | [PATCH] Fix memory leak in isapnp (diff) | |
download | linux-11b0b5abb2097a63c1081d9b7e825b987b227972.tar.xz linux-11b0b5abb2097a63c1081d9b7e825b987b227972.zip |
[PATCH] use kzalloc and kcalloc in core fs code
Signed-off-by: Oliver Neukum <oliver@neukum.name>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/bio.c')
-rw-r--r-- | fs/bio.c | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -636,12 +636,10 @@ static struct bio *__bio_map_user_iov(request_queue_t *q, return ERR_PTR(-ENOMEM); ret = -ENOMEM; - pages = kmalloc(nr_pages * sizeof(struct page *), GFP_KERNEL); + pages = kcalloc(nr_pages, sizeof(struct page *), GFP_KERNEL); if (!pages) goto out; - memset(pages, 0, nr_pages * sizeof(struct page *)); - for (i = 0; i < iov_count; i++) { unsigned long uaddr = (unsigned long)iov[i].iov_base; unsigned long len = iov[i].iov_len; @@ -1186,12 +1184,11 @@ void bioset_free(struct bio_set *bs) struct bio_set *bioset_create(int bio_pool_size, int bvec_pool_size, int scale) { - struct bio_set *bs = kmalloc(sizeof(*bs), GFP_KERNEL); + struct bio_set *bs = kzalloc(sizeof(*bs), GFP_KERNEL); if (!bs) return NULL; - memset(bs, 0, sizeof(*bs)); bs->bio_pool = mempool_create(bio_pool_size, mempool_alloc_slab, mempool_free_slab, bio_slab); |