aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Kent <[email protected]>2016-10-11 13:52:39 -0700
committerLinus Torvalds <[email protected]>2016-10-11 15:06:31 -0700
commit1574fa7beb9f71a60b5b8f2532ca69d3153ded79 (patch)
tree979e92f064fa00700c171e8b6083786c8ffe7273
parent97537b35b662855e19f2812d3d716bde6f237cfa (diff)
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/[email protected] Signed-off-by: Ian Kent <[email protected]> Cc: Tomohiro Kusumi <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r--fs/autofs4/root.c2
1 files changed, 0 insertions, 2 deletions
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;