diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 675112aa998f..4b36621a2eff 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -2914,6 +2914,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 */ @@ -2925,7 +2927,6 @@ out: } kfree(rootrefs); - btrfs_free_path(path); return ret; }