diff options
author | Fabian Frederick <fabf@skynet.be> | 2014-06-25 14:26:21 -0400 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2014-06-25 19:02:14 -0400 |
commit | f15b5041440c502726f121b37cf3923562f8dc6f (patch) | |
tree | cc1a9b708ed992b75d4726618703aa65d2dc2024 /fs | |
parent | 0446278999e5b622b309179ba392efcb5d8b8a46 (diff) |
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: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfs/blocklayout/blocklayout.c | 2 | ||||
-rw-r--r-- | fs/nfs/filelayout/filelayoutdev.c | 2 |
2 files changed, 2 insertions, 2 deletions
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, | |||
1062 | return ERR_PTR(-ENOMEM); | 1062 | return ERR_PTR(-ENOMEM); |
1063 | } | 1063 | } |
1064 | 1064 | ||
1065 | pages = kzalloc(max_pages * sizeof(struct page *), GFP_NOFS); | 1065 | pages = kcalloc(max_pages, sizeof(struct page *), GFP_NOFS); |
1066 | if (pages == NULL) { | 1066 | if (pages == NULL) { |
1067 | kfree(dev); | 1067 | kfree(dev); |
1068 | return ERR_PTR(-ENOMEM); | 1068 | 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, | |||
695 | if (pdev == NULL) | 695 | if (pdev == NULL) |
696 | return NULL; | 696 | return NULL; |
697 | 697 | ||
698 | pages = kzalloc(max_pages * sizeof(struct page *), gfp_flags); | 698 | pages = kcalloc(max_pages, sizeof(struct page *), gfp_flags); |
699 | if (pages == NULL) { | 699 | if (pages == NULL) { |
700 | kfree(pdev); | 700 | kfree(pdev); |
701 | return NULL; | 701 | return NULL; |