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

Commit f15b5041 authored by Fabian Frederick's avatar Fabian Frederick Committed by Trond Myklebust
Browse files

FS/NFS: replace count*size kzalloc by kcalloc



kcalloc manages count*sizeof overflow.

Cc: Trond Myklebust <trond.myklebust@primarydata.com>
Cc: linux-nfs@vger.kernel.org
Signed-off-by: default avatarFabian Frederick <fabf@skynet.be>
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
parent 04462789
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1062,7 +1062,7 @@ nfs4_blk_get_deviceinfo(struct nfs_server *server, const struct nfs_fh *fh,
		return ERR_PTR(-ENOMEM);
	}

	pages = kzalloc(max_pages * sizeof(struct page *), GFP_NOFS);
	pages = kcalloc(max_pages, sizeof(struct page *), GFP_NOFS);
	if (pages == NULL) {
		kfree(dev);
		return ERR_PTR(-ENOMEM);
+1 −1
Original line number Diff line number Diff line
@@ -695,7 +695,7 @@ filelayout_get_device_info(struct inode *inode,
	if (pdev == NULL)
		return NULL;

	pages = kzalloc(max_pages * sizeof(struct page *), gfp_flags);
	pages = kcalloc(max_pages, sizeof(struct page *), gfp_flags);
	if (pages == NULL) {
		kfree(pdev);
		return NULL;