diff options
author | Ian Kent <raven@themaw.net> | 2016-09-10 20:34:23 +1000 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2016-09-10 20:34:23 +1000 |
commit | 603c7412ef20dfaff79709ddf3f47a11020a3de7 (patch) | |
tree | cc86c6a84938876b02a079ce49b37b7a31124ded /fs | |
parent | 9ec1a6e5adaa6b0561c2b6c79c8ba8421a291db9 (diff) | |
download | linux-603c7412ef20dfaff79709ddf3f47a11020a3de7.tar.gz linux-603c7412ef20dfaff79709ddf3f47a11020a3de7.tar.xz |
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 <raven@themaw.net>
Cc: Tomohiro Kusumi <kusumi.tomohiro@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/autofs4/root.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c index fa84bb8832e0..1b0495a970b3 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; |