orangefs: switch decode_dirents() to use of kcalloc()
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 9 Oct 2015 17:23:16 +0000 (13:23 -0400)
committerMike Marshall <hubcap@omnibond.com>
Fri, 13 Nov 2015 16:55:39 +0000 (11:55 -0500)
gets rid of multiplication overflow

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
fs/orangefs/dir.c

index daf497384501c9322d72d089092abeb44e8804fd..280755db181495b81b8677a2817f9f26afc4e234 100644 (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)