Btrfs: dereferencing freed memory
[firefly-linux-kernel-4.4.55.git] / fs / btrfs / ioctl.c
index 5c9f8b30608c8305e75f4c1a95148a322ead409b..874d36e5f167eb879207fe78b56116f1402868b0 100644 (file)
@@ -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)) {