diff options
author | David Sterba <dsterba@suse.cz> | 2015-02-20 12:00:26 -0500 |
---|---|---|
committer | David Sterba <dsterba@suse.cz> | 2015-03-03 11:23:58 -0500 |
commit | 31e818fe7375d60de9953051f7bd1615cebc3681 (patch) | |
tree | c096eb4b8398ada2c04ab459705f436bde969beb /fs/btrfs/inode.c | |
parent | f8c269d7223f6b63cc5936eb191bc3b170d24342 (diff) |
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/inode.c')
-rw-r--r-- | fs/btrfs/inode.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 8564d8ce03de..21e4affafa3e 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -463,7 +463,7 @@ again: | |||
463 | */ | 463 | */ |
464 | if (inode_need_compress(inode)) { | 464 | if (inode_need_compress(inode)) { |
465 | WARN_ON(pages); | 465 | WARN_ON(pages); |
466 | pages = kzalloc(sizeof(struct page *) * nr_pages, GFP_NOFS); | 466 | pages = kcalloc(nr_pages, sizeof(struct page *), GFP_NOFS); |
467 | if (!pages) { | 467 | if (!pages) { |
468 | /* just bail out to the uncompressed code */ | 468 | /* just bail out to the uncompressed code */ |
469 | goto cont; | 469 | goto cont; |