Skip to content

Commit 7914ad4

Browse files
asjkdave
authored andcommitted
btrfs: free btrfs_path before copying subvol info to userspace
btrfs_ioctl_get_subvol_info() frees the search path after the userspace copy from the temp buffer @subvol_info. This can lead to a lock splat warning. Fix this by freeing the path before we copy it to userspace. Signed-off-by: Anand Jain <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent f2454ec commit 7914ad4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/btrfs/ioctl.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2214,6 +2214,8 @@ static int btrfs_ioctl_get_subvol_info(struct inode *inode, void __user *argp)
22142214
}
22152215
}
22162216

2217+
btrfs_free_path(path);
2218+
path = NULL;
22172219
if (copy_to_user(argp, subvol_info, sizeof(*subvol_info)))
22182220
ret = -EFAULT;
22192221

0 commit comments

Comments
 (0)