summaryrefslogtreecommitdiff
path: root/fs/pipe.c
diff options
context:
space:
mode:
authorAl Viro <viro@ftp.linux.org.uk>2006-12-18 16:31:18 +0300
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-21 11:16:03 +0300
commit5ccac88eeb5659c716af8e695e2943509c80d172 (patch)
tree396ef0d405c27e7c22f993c69af752ef3142a125 /fs/pipe.c
parentba6d8b1eba88665d12edd53385d3e26fce5613a3 (diff)
downloadlinux-5ccac88eeb5659c716af8e695e2943509c80d172.tar.xz
[PATCH] fix leaks on pipe(2) failure exits
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/pipe.c')
-rw-r--r--fs/pipe.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/pipe.c b/fs/pipe.c
index 9a06e8e48e8d..68090e84f589 100644
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -935,8 +935,9 @@ struct file *create_write_pipe(void)
void free_write_pipe(struct file *f)
{
- mntput(f->f_path.mnt);
+ free_pipe_info(f->f_dentry->d_inode);
dput(f->f_path.dentry);
+ mntput(f->f_path.mnt);
put_filp(f);
}
@@ -994,6 +995,8 @@ int do_pipe(int *fd)
err_fdr:
put_unused_fd(fdr);
err_read_pipe:
+ dput(fr->f_dentry);
+ mntput(fr->f_vfsmnt);
put_filp(fr);
err_write_pipe:
free_write_pipe(fw);