Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ef4af94e authored by Al Viro's avatar Al Viro Committed by Mike Marshall
Browse files

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



gets rid of multiplication overflow

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarMike Marshall <hubcap@omnibond.com>
parent 5714156b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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)