Skip to content

Commit 5ccac88

Browse files
Al ViroLinus Torvalds
authored andcommitted
[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>
1 parent ba6d8b1 commit 5ccac88

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

fs/pipe.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -935,8 +935,9 @@ struct file *create_write_pipe(void)
935935

936936
void free_write_pipe(struct file *f)
937937
{
938-
mntput(f->f_path.mnt);
938+
free_pipe_info(f->f_dentry->d_inode);
939939
dput(f->f_path.dentry);
940+
mntput(f->f_path.mnt);
940941
put_filp(f);
941942
}
942943

@@ -994,6 +995,8 @@ int do_pipe(int *fd)
994995
err_fdr:
995996
put_unused_fd(fdr);
996997
err_read_pipe:
998+
dput(fr->f_dentry);
999+
mntput(fr->f_vfsmnt);
9971000
put_filp(fr);
9981001
err_write_pipe:
9991002
free_write_pipe(fw);

0 commit comments

Comments
 (0)