summaryrefslogtreecommitdiffstats
path: root/fs/btrfs
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2010-03-20 12:24:48 +0100
committerChris Mason <chris.mason@oracle.com>2010-03-31 03:19:09 +0200
commit683be16eb6e19a35aca2473668652259ed074094 (patch)
treee6ed753b392a576999140ab9758db9c58dc60926 /fs/btrfs
parentBtrfs: Simplify num_stripes's calculation logical for __btrfs_alloc_chunk() (diff)
downloadlinux-683be16eb6e19a35aca2473668652259ed074094.tar.xz
linux-683be16eb6e19a35aca2473668652259ed074094.zip
Btrfs: dereferencing freed memory
The original code dereferenced range on the next line. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/ioctl.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 5c9f8b30608c..874d36e5f167 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -1374,6 +1374,7 @@ static int btrfs_ioctl_defrag(struct file *file, void __user *argp)
sizeof(*range))) {
ret = -EFAULT;
kfree(range);
+ goto out;
}
/* compression requires us to start the IO */
if ((range->flags & BTRFS_DEFRAG_RANGE_COMPRESS)) {