aboutsummaryrefslogtreecommitdiffstats
path: root/fs/namei.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/namei.c b/fs/namei.c
index 9802345df5e7..6301963b161f 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2713,8 +2713,10 @@ static long do_unlinkat(int dfd, const char __user *pathname)
2713 error = PTR_ERR(dentry); 2713 error = PTR_ERR(dentry);
2714 if (!IS_ERR(dentry)) { 2714 if (!IS_ERR(dentry)) {
2715 /* Why not before? Because we want correct error value */ 2715 /* Why not before? Because we want correct error value */
2716 if (nd.last.name[nd.last.len])
2717 goto slashes;
2716 inode = dentry->d_inode; 2718 inode = dentry->d_inode;
2717 if (nd.last.name[nd.last.len] || !inode) 2719 if (!inode)
2718 goto slashes; 2720 goto slashes;
2719 ihold(inode); 2721 ihold(inode);
2720 error = mnt_want_write(nd.path.mnt); 2722 error = mnt_want_write(nd.path.mnt);