summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/free-space-cache.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.cz>2015-02-20 18:00:26 +0100
committerDavid Sterba <dsterba@suse.cz>2015-03-03 17:23:58 +0100
commit31e818fe7375d60de9953051f7bd1615cebc3681 (patch)
treec096eb4b8398ada2c04ab459705f436bde969beb /fs/btrfs/free-space-cache.c
parentf8c269d7223f6b63cc5936eb191bc3b170d24342 (diff)
downloadlinux-31e818fe7375d60de9953051f7bd1615cebc3681.tar.bz2
btrfs: cleanup, use kmalloc_array/kcalloc array helpers
Convert kmalloc(nr * size, ..) to kmalloc_array that does additional overflow checks, the zeroing variant is kcalloc. Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'fs/btrfs/free-space-cache.c')
-rw-r--r--fs/btrfs/free-space-cache.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c
index cb84923561e4..6e5d0abec6f9 100644
--- a/fs/btrfs/free-space-cache.c
+++ b/fs/btrfs/free-space-cache.c
@@ -298,7 +298,7 @@ static int io_ctl_init(struct io_ctl *io_ctl, struct inode *inode,
memset(io_ctl, 0, sizeof(struct io_ctl));
- io_ctl->pages = kzalloc(sizeof(struct page *) * num_pages, GFP_NOFS);
+ io_ctl->pages = kcalloc(num_pages, sizeof(struct page *), GFP_NOFS);
if (!io_ctl->pages)
return -ENOMEM;