From ef4af94edcf8fc32ab1d4141537a4eb29ff45a40 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Fri, 9 Oct 2015 13:23:16 -0400 Subject: orangefs: switch decode_dirents() to use of kcalloc() gets rid of multiplication overflow Signed-off-by: Al Viro Signed-off-by: Mike Marshall --- fs/orangefs/dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs/orangefs/dir.c') diff --git a/fs/orangefs/dir.c b/fs/orangefs/dir.c index daf497384501..280755db1814 100644 --- a/fs/orangefs/dir.c +++ b/fs/orangefs/dir.c @@ -27,7 +27,7 @@ static long decode_dirents(char *ptr, struct pvfs2_readdir_response_s *readdir) readdir->token = rd->token; readdir->pvfs_dirent_outcount = rd->pvfs_dirent_outcount; - readdir->dirent_array = kmalloc(readdir->pvfs_dirent_outcount * + readdir->dirent_array = kcalloc(readdir->pvfs_dirent_outcount, sizeof(*readdir->dirent_array), GFP_KERNEL); if (readdir->dirent_array == NULL) -- cgit