aboutsummaryrefslogtreecommitdiffstats
path: root/fs/bio.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/bio.c')
-rw-r--r--fs/bio.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/bio.c b/fs/bio.c
index 0a8c59cb68f5..73e664c01d30 100644
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -636,12 +636,10 @@ static struct bio *__bio_map_user_iov(request_queue_t *q,
636 return ERR_PTR(-ENOMEM); 636 return ERR_PTR(-ENOMEM);
637 637
638 ret = -ENOMEM; 638 ret = -ENOMEM;
639 pages = kmalloc(nr_pages * sizeof(struct page *), GFP_KERNEL); 639 pages = kcalloc(nr_pages, sizeof(struct page *), GFP_KERNEL);
640 if (!pages) 640 if (!pages)
641 goto out; 641 goto out;
642 642
643 memset(pages, 0, nr_pages * sizeof(struct page *));
644
645 for (i = 0; i < iov_count; i++) { 643 for (i = 0; i < iov_count; i++) {
646 unsigned long uaddr = (unsigned long)iov[i].iov_base; 644 unsigned long uaddr = (unsigned long)iov[i].iov_base;
647 unsigned long len = iov[i].iov_len; 645 unsigned long len = iov[i].iov_len;
@@ -1186,12 +1184,11 @@ void bioset_free(struct bio_set *bs)
1186 1184
1187struct bio_set *bioset_create(int bio_pool_size, int bvec_pool_size, int scale) 1185struct bio_set *bioset_create(int bio_pool_size, int bvec_pool_size, int scale)
1188{ 1186{
1189 struct bio_set *bs = kmalloc(sizeof(*bs), GFP_KERNEL); 1187 struct bio_set *bs = kzalloc(sizeof(*bs), GFP_KERNEL);
1190 1188
1191 if (!bs) 1189 if (!bs)
1192 return NULL; 1190 return NULL;
1193 1191
1194 memset(bs, 0, sizeof(*bs));
1195 bs->bio_pool = mempool_create(bio_pool_size, mempool_alloc_slab, 1192 bs->bio_pool = mempool_create(bio_pool_size, mempool_alloc_slab,
1196 mempool_free_slab, bio_slab); 1193 mempool_free_slab, bio_slab);
1197 1194