Skip to contentSkip to conversation

btrfs: dereferencing freed memory

PATCH New Dan Carpenter 1 participant 1 message Mar 20, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 3/3 btrfs: dereferencing freed memory

The original code dereferenced range on the next line.

fs/btrfs/ioctl.c +1 -0
index be9b5df..d7ab56c 100644
@@ -1378,6 +1378,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)) {