diff options
-rw-r--r-- | fs/btrfs/super.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 994c40955315..53bc3733d483 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c | |||
@@ -1186,7 +1186,6 @@ static struct dentry *mount_subvol(const char *subvol_name, int flags, | |||
1186 | return ERR_PTR(-ENOMEM); | 1186 | return ERR_PTR(-ENOMEM); |
1187 | mnt = vfs_kern_mount(&btrfs_fs_type, flags, device_name, | 1187 | mnt = vfs_kern_mount(&btrfs_fs_type, flags, device_name, |
1188 | newargs); | 1188 | newargs); |
1189 | kfree(newargs); | ||
1190 | 1189 | ||
1191 | if (PTR_RET(mnt) == -EBUSY) { | 1190 | if (PTR_RET(mnt) == -EBUSY) { |
1192 | if (flags & MS_RDONLY) { | 1191 | if (flags & MS_RDONLY) { |
@@ -1196,17 +1195,22 @@ static struct dentry *mount_subvol(const char *subvol_name, int flags, | |||
1196 | int r; | 1195 | int r; |
1197 | mnt = vfs_kern_mount(&btrfs_fs_type, flags | MS_RDONLY, device_name, | 1196 | mnt = vfs_kern_mount(&btrfs_fs_type, flags | MS_RDONLY, device_name, |
1198 | newargs); | 1197 | newargs); |
1199 | if (IS_ERR(mnt)) | 1198 | if (IS_ERR(mnt)) { |
1199 | kfree(newargs); | ||
1200 | return ERR_CAST(mnt); | 1200 | return ERR_CAST(mnt); |
1201 | } | ||
1201 | 1202 | ||
1202 | r = btrfs_remount(mnt->mnt_sb, &flags, NULL); | 1203 | r = btrfs_remount(mnt->mnt_sb, &flags, NULL); |
1203 | if (r < 0) { | 1204 | if (r < 0) { |
1204 | /* FIXME: release vfsmount mnt ??*/ | 1205 | /* FIXME: release vfsmount mnt ??*/ |
1206 | kfree(newargs); | ||
1205 | return ERR_PTR(r); | 1207 | return ERR_PTR(r); |
1206 | } | 1208 | } |
1207 | } | 1209 | } |
1208 | } | 1210 | } |
1209 | 1211 | ||
1212 | kfree(newargs); | ||
1213 | |||
1210 | if (IS_ERR(mnt)) | 1214 | if (IS_ERR(mnt)) |
1211 | return ERR_CAST(mnt); | 1215 | return ERR_CAST(mnt); |
1212 | 1216 | ||