提交 1813badd 编写于 作者: T Trond Myklebust

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

Don't circumvent the array size checks.
Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
上级 d527e5c1
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册