Commit 4294a8eedb17bbc45e1e7447c2a4d05332943248
Committed by
Al Viro
1 parent
4919c5e45a
Exists in
master
and in
39 other branches
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>
Showing 1 changed file with 1 additions and 2 deletions Side-by-side Diff
ipc/mqueue.c
... | ... | @@ -705,7 +705,7 @@ |
705 | 705 | dentry = lookup_one_len(name, ipc_ns->mq_mnt->mnt_root, strlen(name)); |
706 | 706 | if (IS_ERR(dentry)) { |
707 | 707 | error = PTR_ERR(dentry); |
708 | - goto out_err; | |
708 | + goto out_putfd; | |
709 | 709 | } |
710 | 710 | mntget(ipc_ns->mq_mnt); |
711 | 711 | |
... | ... | @@ -742,7 +742,6 @@ |
742 | 742 | mntput(ipc_ns->mq_mnt); |
743 | 743 | out_putfd: |
744 | 744 | put_unused_fd(fd); |
745 | -out_err: | |
746 | 745 | fd = error; |
747 | 746 | out_upsem: |
748 | 747 | mutex_unlock(&ipc_ns->mq_mnt->mnt_root->d_inode->i_mutex); |