Commit 1813badd authored by Trond Myklebust's avatar Trond Myklebust
Browse files

NFSv4.1: Use kcalloc() to allocate zeroed arrays instead of kzalloc()



Don't circumvent the array size checks.

Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent d527e5c1
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -750,7 +750,7 @@ filelayout_decode_layout(struct pnfs_layout_hdr *flo,
		goto out_err;
		goto out_err;


	if (fl->num_fh > 0) {
	if (fl->num_fh > 0) {
		fl->fh_array = kzalloc(fl->num_fh * sizeof(struct nfs_fh *),
		fl->fh_array = kcalloc(fl->num_fh, sizeof(fl->fh_array[0]),
				       gfp_flags);
				       gfp_flags);
		if (!fl->fh_array)
		if (!fl->fh_array)
			goto out_err;
			goto out_err;