summaryrefslogtreecommitdiff
path: root/fs/btrfs/ioctl.c
diff options
context:
space:
mode:
authorDulshani Gunawardhana <dulshani.gunawardhana89@gmail.com>2013-10-31 10:32:18 +0530
committerChris Mason <chris.mason@fusionio.com>2013-11-11 22:12:22 -0500
commitd9b0d9ba04cf99abff9125b688c03e154598a644 (patch)
tree19d5fd9776a761379a89a1f87e452973bd9685a1 /fs/btrfs/ioctl.c
parente248e04e7798d234ddbeab6ee6acdec2476fe1a8 (diff)
downloadlwn-d9b0d9ba04cf99abff9125b688c03e154598a644.tar.gz
lwn-d9b0d9ba04cf99abff9125b688c03e154598a644.zip
btrfs: Replace kmalloc with kmalloc_array
Replace kmalloc(size * nr, ) with kmalloc_array(nr, size), thus making it easier to check is that the calculation doesn't wrap or return a smaller allocation Signed-off-by: Dulshani Gunawardhana <dulshani.gunawardhana89@gmail.com> Reviewed-by: Zach Brown <zab@redhat.com> Signed-off-by: Josef Bacik <jbacik@fusionio.com> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'fs/btrfs/ioctl.c')
-rw-r--r--fs/btrfs/ioctl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 78d20482b72a..3712ef86ca82 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -1198,7 +1198,7 @@ int btrfs_defrag_file(struct inode *inode, struct file *file,
ra = &file->f_ra;
}
- pages = kmalloc(sizeof(struct page *) * max_cluster,
+ pages = kmalloc_array(max_cluster, sizeof(struct page *),
GFP_NOFS);
if (!pages) {
ret = -ENOMEM;