]> err.no Git - linux-2.6/commitdiff
[PATCH] double-free of inode on alloc_file() failure exit in create_write_pipe()
authorAl Viro <viro@zeniv.linux.org.uk>
Tue, 22 Apr 2008 23:51:27 +0000 (19:51 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 22 Apr 2008 23:54:57 +0000 (19:54 -0400)
Duh...  Fortunately, the bug is quite recent (post-2.6.25) and, embarrassingly,
mine ;-/

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/pipe.c

index 8be381bbcb54ad4108ea3bf453b19afd702314b5..f73492b6817ea37d356b63f8bdfd81a960156ca7 100644 (file)
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -988,7 +988,10 @@ struct file *create_write_pipe(void)
        return f;
 
  err_dentry:
+       free_pipe_info(inode);
        dput(dentry);
+       return ERR_PTR(err);
+
  err_inode:
        free_pipe_info(inode);
        iput(inode);