mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-09-20 19:34:46 +00:00
VFS: Properly free dentry name snapshots in vfs_rename2
An error in commit 0a420e78c31b ("BACKPORT: dentry name snapshots") errantly replaced the fsnotify_oldname_free() with a take_dentry_name_snapshot() instead of the intended release_dentry_name_snapshot() as demonstrated in the upstream commit. This results in taking another snapshot and leaking of the memory allocated for the snapshot name. Change-Id: I13356a0cc12fbaf63330d6781ad65ed735e6bc0d Signed-off-by: Kevin F. Haggerty <haggertk@lineageos.org> Fixes: 0a420e78c31b ("BACKPORT: dentry name snapshots")
This commit is contained in:
parent
680001a578
commit
63cbbceed4
|
@ -3994,7 +3994,7 @@ int vfs_rename2(struct vfsmount *mnt,
|
|||
if (!error)
|
||||
fsnotify_move(old_dir, new_dir, old_name.name, is_dir,
|
||||
new_dentry->d_inode, old_dentry);
|
||||
take_dentry_name_snapshot(&old_name, old_dentry);
|
||||
release_dentry_name_snapshot(&old_name);
|
||||
|
||||
return error;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue