diff options
author | David Sterba <dsterba@suse.cz> | 2015-02-20 20:00:26 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.cz> | 2015-03-03 19:23:58 +0300 |
commit | 31e818fe7375d60de9953051f7bd1615cebc3681 (patch) | |
tree | c096eb4b8398ada2c04ab459705f436bde969beb /fs/btrfs/raid56.c | |
parent | f8c269d7223f6b63cc5936eb191bc3b170d24342 (diff) | |
download | linux-31e818fe7375d60de9953051f7bd1615cebc3681.tar.xz |
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/raid56.c')
-rw-r--r-- | fs/btrfs/raid56.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/btrfs/raid56.c b/fs/btrfs/raid56.c index 5264858ed768..b4634c30981e 100644 --- a/fs/btrfs/raid56.c +++ b/fs/btrfs/raid56.c @@ -1807,8 +1807,7 @@ static void __raid_recover_end_io(struct btrfs_raid_bio *rbio) int err; int i; - pointers = kzalloc(rbio->real_stripes * sizeof(void *), - GFP_NOFS); + pointers = kcalloc(rbio->real_stripes, sizeof(void *), GFP_NOFS); if (!pointers) { err = -ENOMEM; goto cleanup_io; |