orangefs: switch decode_dirents() to use of kcalloc()

gets rid of multiplication overflow

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
This commit is contained in:
Al Viro 2015-10-09 13:23:16 -04:00 committed by Mike Marshall
parent 5714156be2
commit ef4af94edc

View File

@ -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)