summaryrefslogtreecommitdiffstats
path: root/fs/namei.c
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2011-06-17 16:32:26 +0200
committerGrant Likely <grant.likely@secretlab.ca>2011-06-17 16:32:26 +0200
commitf8db4cc4f2b11bdded6c94f0d55906847474b982 (patch)
treed1b99d186edb9d203fafd896f19487125a2395af /fs/namei.c
parentspi/topcliff-pch: Support new device ML7223 IOH (diff)
parentspi/bfin_spi: fix handling of default bits per word setting (diff)
downloadlinux-f8db4cc4f2b11bdded6c94f0d55906847474b982.tar.xz
linux-f8db4cc4f2b11bdded6c94f0d55906847474b982.zip
Merge branch 'spi/merge' into spi/next
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/fs/namei.c b/fs/namei.c
index e2e4e8d032ee..9802345df5e7 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2624,6 +2624,10 @@ static long do_rmdir(int dfd, const char __user *pathname)
error = PTR_ERR(dentry);
if (IS_ERR(dentry))
goto exit2;
+ if (!dentry->d_inode) {
+ error = -ENOENT;
+ goto exit3;
+ }
error = mnt_want_write(nd.path.mnt);
if (error)
goto exit3;
@@ -2709,11 +2713,10 @@ static long do_unlinkat(int dfd, const char __user *pathname)
error = PTR_ERR(dentry);
if (!IS_ERR(dentry)) {
/* Why not before? Because we want correct error value */
- if (nd.last.name[nd.last.len])
- goto slashes;
inode = dentry->d_inode;
- if (inode)
- ihold(inode);
+ if (nd.last.name[nd.last.len] || !inode)
+ goto slashes;
+ ihold(inode);
error = mnt_want_write(nd.path.mnt);
if (error)
goto exit2;