From: Fabian Frederick Date: Wed, 25 Jun 2014 18:26:21 +0000 (+0200) Subject: FS/NFS: replace count*size kzalloc by kcalloc X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f15b5041440c502726f121b37cf3923562f8dc6f;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git FS/NFS: replace count*size kzalloc by kcalloc kcalloc manages count*sizeof overflow. Cc: Trond Myklebust Cc: linux-nfs@vger.kernel.org Signed-off-by: Fabian Frederick Signed-off-by: Trond Myklebust --- diff --git a/fs/nfs/blocklayout/blocklayout.c b/fs/nfs/blocklayout/blocklayout.c index 04ac32b339f8..cbb1797149d5 100644 --- a/fs/nfs/blocklayout/blocklayout.c +++ b/fs/nfs/blocklayout/blocklayout.c @@ -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); diff --git a/fs/nfs/filelayout/filelayoutdev.c b/fs/nfs/filelayout/filelayoutdev.c index 44bf0140a4c7..48f8dcdb75db 100644 --- a/fs/nfs/filelayout/filelayoutdev.c +++ b/fs/nfs/filelayout/filelayoutdev.c @@ -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;