aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/disk-io.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.cz>2015-02-20 12:00:26 -0500
committerDavid Sterba <dsterba@suse.cz>2015-03-03 11:23:58 -0500
commit31e818fe7375d60de9953051f7bd1615cebc3681 (patch)
treec096eb4b8398ada2c04ab459705f436bde969beb /fs/btrfs/disk-io.c
parentf8c269d7223f6b63cc5936eb191bc3b170d24342 (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/disk-io.c')
-rw-r--r--fs/btrfs/disk-io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 73b152138221..14e4a3e0f9b2 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -302,7 +302,7 @@ static int csum_tree_block(struct btrfs_root *root, struct extent_buffer *buf,
302 offset += cur_len; 302 offset += cur_len;
303 } 303 }
304 if (csum_size > sizeof(inline_result)) { 304 if (csum_size > sizeof(inline_result)) {
305 result = kzalloc(csum_size * sizeof(char), GFP_NOFS); 305 result = kzalloc(csum_size, GFP_NOFS);
306 if (!result) 306 if (!result)
307 return 1; 307 return 1;
308 } else { 308 } else {