mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
[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:
parent
656bde5728
commit
11b0b5abb2
8 changed files with 10 additions and 22 deletions
7
fs/bio.c
7
fs/bio.c
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue