mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
ANDROID: mnt: Fix freeing of mount data
Fix double free on error paths Signed-off-by: Daniel Rosenberg <drosen@google.com> Change-Id: I1c25a175e87e5dd5cafcdcf9d78bf4c0dc3f88ef Bug: 65386954 Fixes: aa6d3ace42f9 ("mnt: Add filesystem private data to mount points")
This commit is contained in:
parent
fc4f69b077
commit
7a97e952ea
1 changed files with 1 additions and 3 deletions
|
@ -186,6 +186,7 @@ static struct mount *alloc_vfsmnt(const char *name)
|
|||
mnt->mnt_count = 1;
|
||||
mnt->mnt_writers = 0;
|
||||
#endif
|
||||
mnt->mnt.data = NULL;
|
||||
|
||||
INIT_LIST_HEAD(&mnt->mnt_hash);
|
||||
INIT_LIST_HEAD(&mnt->mnt_child);
|
||||
|
@ -699,7 +700,6 @@ vfs_kern_mount(struct file_system_type *type, int flags, const char *name, void
|
|||
if (!mnt)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
mnt->mnt.data = NULL;
|
||||
if (type->alloc_mnt_data) {
|
||||
mnt->mnt.data = type->alloc_mnt_data();
|
||||
if (!mnt->mnt.data) {
|
||||
|
@ -713,7 +713,6 @@ vfs_kern_mount(struct file_system_type *type, int flags, const char *name, void
|
|||
|
||||
root = mount_fs(type, flags, name, &mnt->mnt, data);
|
||||
if (IS_ERR(root)) {
|
||||
kfree(mnt->mnt.data);
|
||||
free_vfsmnt(mnt);
|
||||
return ERR_CAST(root);
|
||||
}
|
||||
|
@ -793,7 +792,6 @@ static struct mount *clone_mnt(struct mount *old, struct dentry *root,
|
|||
return mnt;
|
||||
|
||||
out_free:
|
||||
kfree(mnt->mnt.data);
|
||||
free_vfsmnt(mnt);
|
||||
return ERR_PTR(err);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue