summaryrefslogtreecommitdiffstats
path: root/security/inode.c
diff options
context:
space:
mode:
authorTakashi Iwai2010-08-18 15:17:30 +0200
committerTakashi Iwai2010-08-18 15:17:30 +0200
commit6ab561c8aab2e4af535f09adbc6253f958536848 (patch)
tree37846adb4ea106485720d113e252d71d615c23ed /security/inode.c
parentALSA: usb: USB3 SuperSpeed sound support (diff)
parentALSA: ISA: Remove snd-sgalaxy (diff)
downloadkernel-qcow2-linux-6ab561c8aab2e4af535f09adbc6253f958536848.tar.gz
kernel-qcow2-linux-6ab561c8aab2e4af535f09adbc6253f958536848.tar.xz
kernel-qcow2-linux-6ab561c8aab2e4af535f09adbc6253f958536848.zip
Merge branch 'topic/isa' into topic/misc
Diffstat (limited to 'security/inode.c')
-rw-r--r--security/inode.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/security/inode.c b/security/inode.c
index 1c812e874504..8c777f022ad1 100644
--- a/security/inode.c
+++ b/security/inode.c
@@ -86,7 +86,7 @@ static int mknod(struct inode *dir, struct dentry *dentry,
int mode, dev_t dev)
{
struct inode *inode;
- int error = -EPERM;
+ int error = -ENOMEM;
if (dentry->d_inode)
return -EEXIST;
@@ -166,6 +166,8 @@ static int create_by_name(const char *name, mode_t mode,
error = mkdir(parent->d_inode, *dentry, mode);
else
error = create(parent->d_inode, *dentry, mode);
+ if (error)
+ dput(*dentry);
} else
error = PTR_ERR(*dentry);
mutex_unlock(&parent->d_inode->i_mutex);