aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAl Viro <viro@ftp.linux.org.uk>2006-12-18 08:31:18 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-21 03:16:03 -0500
commit5ccac88eeb5659c716af8e695e2943509c80d172 (patch)
tree396ef0d405c27e7c22f993c69af752ef3142a125 /fs
parentba6d8b1eba88665d12edd53385d3e26fce5613a3 (diff)
[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')
-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)
935 935
936void free_write_pipe(struct file *f) 936void free_write_pipe(struct file *f)
937{ 937{
938 mntput(f->f_path.mnt); 938 free_pipe_info(f->f_dentry->d_inode);
939 dput(f->f_path.dentry); 939 dput(f->f_path.dentry);
940 mntput(f->f_path.mnt);
940 put_filp(f); 941 put_filp(f);
941} 942}
942 943
@@ -994,6 +995,8 @@ int do_pipe(int *fd)
994 err_fdr: 995 err_fdr:
995 put_unused_fd(fdr); 996 put_unused_fd(fdr);
996 err_read_pipe: 997 err_read_pipe:
998 dput(fr->f_dentry);
999 mntput(fr->f_vfsmnt);
997 put_filp(fr); 1000 put_filp(fr);
998 err_write_pipe: 1001 err_write_pipe:
999 free_write_pipe(fw); 1002 free_write_pipe(fw);