2014-06-23 16:36:37

by Fabian Frédérick

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

kcalloc manages count*sizeof overflow.

Cc: Miklos Szeredi <[email protected]>
Cc: [email protected]
Signed-off-by: Fabian Frederick <[email protected]>
---
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