fuse: replace count*size kzalloc by kcalloc
authorFabian Frederick <fabf@skynet.be>
Mon, 23 Jun 2014 16:35:15 +0000 (18:35 +0200)
committerMiklos Szeredi <mszeredi@suse.cz>
Mon, 14 Jul 2014 14:30:25 +0000 (16:30 +0200)
kcalloc manages count*sizeof overflow.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
fs/fuse/file.c

index 35b6f31ecc3881928b21fca470de0c8abc43378f..1570dad1915d6aec0d1014d28b8c834f28064944 100644 (file)
@@ -1992,8 +1992,8 @@ static int fuse_writepages(struct address_space *mapping,
        data.ff = NULL;
 
        err = -ENOMEM;
-       data.orig_pages = kzalloc(sizeof(struct page *) *
-                                 FUSE_MAX_PAGES_PER_REQ,
+       data.orig_pages = kcalloc(FUSE_MAX_PAGES_PER_REQ,
+                                 sizeof(struct page *),
                                  GFP_NOFS);
        if (!data.orig_pages)
                goto out;