Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1574fa7b authored by Ian Kent's avatar Ian Kent Committed by Linus Torvalds
Browse files

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: default avatarIan Kent <raven@themaw.net>
Cc: Tomohiro Kusumi <kusumi.tomohiro@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 97537b35
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -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;