diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index b9dcaae7c8d5..72ede0280c74 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -2880,6 +2880,8 @@ static int btrfs_ioctl_get_subvol_rootref(struct file *file, void __user *argp) } out: + btrfs_free_path(path); + if (!ret || ret == -EOVERFLOW) { rootrefs->num_items = found; /* update min_treeid for next search */ @@ -2891,7 +2893,6 @@ out: } kfree(rootrefs); - btrfs_free_path(path); return ret; }