Skip to content

Commit

Permalink
[PATCH] fix leaks on pipe(2) failure exits
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Al Viro authored and Linus Torvalds committed Dec 21, 2006
1 parent ba6d8b1 commit 5ccac88
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fs/pipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 5ccac88

Please sign in to comment.