From: Trond Myklebust Date: Thu, 11 Oct 2012 18:36:52 +0000 (-0400) Subject: NFSv4.1: Use kcalloc() to allocate zeroed arrays instead of kzalloc() X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=1813badd98ce02e4b96d8997b68ddef4d4ad4ec5;p=openwrt%2Fstaging%2Fblogic.git NFSv4.1: Use kcalloc() to allocate zeroed arrays instead of kzalloc() Don't circumvent the array size checks. Signed-off-by: Trond Myklebust --- diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c index e7aee566861d..2e45fd9c02a3 100644 --- a/fs/nfs/nfs4filelayout.c +++ b/fs/nfs/nfs4filelayout.c @@ -750,7 +750,7 @@ filelayout_decode_layout(struct pnfs_layout_hdr *flo, goto out_err; 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); if (!fl->fh_array) goto out_err;