[PATCH 1/1] fs/fuse/file.c: replace count*size kzalloc by kcalloc

From: Fabian Frederick
Date: Mon Jun 23 2014 - 12:36:41 EST


kcalloc manages count*sizeof overflow.

Cc: Miklos Szeredi <miklos@xxxxxxxxxx>
Cc: fuse-devel@xxxxxxxxxxxxxxxxxxxxx
Signed-off-by: Fabian Frederick <fabf@xxxxxxxxx>
---
fs/fuse/file.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index 6e16dad..ce7d55c 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -1955,8 +1955,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;
--
1.8.4.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/