diff options
author | André Goddard Rosa <andre.goddard@gmail.com> | 2010-02-23 04:04:28 -0300 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2010-03-03 14:46:05 -0500 |
commit | 4294a8eedb17bbc45e1e7447c2a4d05332943248 (patch) | |
tree | db83b372de61b43208e08a97dd5f0280552d7ffa /ipc | |
parent | 4919c5e45a91b5db5a41695fe0357fbdff0d5767 (diff) | |
download | kernel_samsung_smdk4412-4294a8eedb17bbc45e1e7447c2a4d05332943248.tar.gz kernel_samsung_smdk4412-4294a8eedb17bbc45e1e7447c2a4d05332943248.tar.bz2 kernel_samsung_smdk4412-4294a8eedb17bbc45e1e7447c2a4d05332943248.zip |
mqueue: fix mq_open() file descriptor leak on user-space processes
We leak fd on lookup_one_len() failure
Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'ipc')
-rw-r--r-- | ipc/mqueue.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/ipc/mqueue.c b/ipc/mqueue.c index c79bd57353e..04985a7256c 100644 --- a/ipc/mqueue.c +++ b/ipc/mqueue.c @@ -705,7 +705,7 @@ SYSCALL_DEFINE4(mq_open, const char __user *, u_name, int, oflag, mode_t, mode, dentry = lookup_one_len(name, ipc_ns->mq_mnt->mnt_root, strlen(name)); if (IS_ERR(dentry)) { error = PTR_ERR(dentry); - goto out_err; + goto out_putfd; } mntget(ipc_ns->mq_mnt); @@ -742,7 +742,6 @@ out: mntput(ipc_ns->mq_mnt); out_putfd: put_unused_fd(fd); -out_err: fd = error; out_upsem: mutex_unlock(&ipc_ns->mq_mnt->mnt_root->d_inode->i_mutex); |