Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs fix from Al Viro: "Fixes an obvious bug (memory leak introduced in 5.8)" * 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: pipe: Fix memory leaks in create_pipe_files()
This commit is contained in:
11
fs/pipe.c
11
fs/pipe.c
@@ -894,19 +894,18 @@ int create_pipe_files(struct file **res, int flags)
|
||||
{
|
||||
struct inode *inode = get_pipe_inode();
|
||||
struct file *f;
|
||||
int error;
|
||||
|
||||
if (!inode)
|
||||
return -ENFILE;
|
||||
|
||||
if (flags & O_NOTIFICATION_PIPE) {
|
||||
#ifdef CONFIG_WATCH_QUEUE
|
||||
if (watch_queue_init(inode->i_pipe) < 0) {
|
||||
error = watch_queue_init(inode->i_pipe);
|
||||
if (error) {
|
||||
free_pipe_info(inode->i_pipe);
|
||||
iput(inode);
|
||||
return -ENOMEM;
|
||||
return error;
|
||||
}
|
||||
#else
|
||||
return -ENOPKG;
|
||||
#endif
|
||||
}
|
||||
|
||||
f = alloc_file_pseudo(inode, pipe_mnt, "",
|
||||
|
Reference in New Issue
Block a user