diff options
author | David Sterba <dsterba@suse.cz> | 2015-02-20 18:00:26 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.cz> | 2015-03-03 17:23:58 +0100 |
commit | 31e818fe7375d60de9953051f7bd1615cebc3681 (patch) | |
tree | c096eb4b8398ada2c04ab459705f436bde969beb /fs/btrfs/scrub.c | |
parent | f8c269d7223f6b63cc5936eb191bc3b170d24342 (diff) | |
download | lwn-31e818fe7375d60de9953051f7bd1615cebc3681.tar.gz lwn-31e818fe7375d60de9953051f7bd1615cebc3681.zip |
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/scrub.c')
-rw-r--r-- | fs/btrfs/scrub.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index db21f17df996..5a7d63cd9c25 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs/scrub.c @@ -964,9 +964,8 @@ static int scrub_handle_errored_block(struct scrub_block *sblock_to_check) * the statistics. */ - sblocks_for_recheck = kzalloc(BTRFS_MAX_MIRRORS * - sizeof(*sblocks_for_recheck), - GFP_NOFS); + sblocks_for_recheck = kcalloc(BTRFS_MAX_MIRRORS, + sizeof(*sblocks_for_recheck), GFP_NOFS); if (!sblocks_for_recheck) { spin_lock(&sctx->stat_lock); sctx->stat.malloc_errors++; |