autofs: remove ino free in autofs4_dir_symlink()
authorIan Kent <raven@themaw.net>
Sat, 10 Sep 2016 10:34:23 +0000 (20:34 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Sat, 10 Sep 2016 10:34:23 +0000 (20:34 +1000)
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 <raven@themaw.net>
Cc: Tomohiro Kusumi <kusumi.tomohiro@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/autofs4/root.c

index fa84bb8832e0baefc79c07759e9f7f518e023988..1b0495a970b381c688efae6aaab83f6e4727ae93 100644 (file)
@@ -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;
This page took 0.025074 seconds and 5 git commands to generate.