From: Ian Kent Date: Tue, 11 Oct 2016 20:52:39 +0000 (-0700) Subject: autofs: remove ino free in autofs4_dir_symlink() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1574fa7beb9f71a60b5b8f2532ca69d3153ded79;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git autofs: remove ino free in autofs4_dir_symlink() The inode allocation failure case in autofs4_dir_symlink() frees the autofs dentry info of the dentry without setting ->d_fsdata to NULL. That could lead to a double free so just get rid of the free and leave it to ->d_release(). Link: http://lkml.kernel.org/r/20160812024759.12352.10653.stgit@pluto.themaw.net Signed-off-by: Ian Kent Cc: Tomohiro Kusumi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c index 623510e84c96..2eebeae75288 100644 --- a/fs/autofs4/root.c +++ b/fs/autofs4/root.c @@ -577,8 +577,6 @@ static int autofs4_dir_symlink(struct inode *dir, inode = autofs4_get_inode(dir->i_sb, S_IFLNK | 0555); if (!inode) { kfree(cp); - if (!dentry->d_fsdata) - kfree(ino); return -ENOMEM; } inode->i_private = cp;