diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2020-10-11 20:11:35 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2020-10-11 20:11:35 +0200 |
commit | 5b697f86f9f136d200c9827d6eca0437b7eb96cf (patch) | |
tree | c6e57bb516131f673a9b77293e1a9db136bf1365 /fs/pipe.c | |
parent | Merge tag 'x86-urgent-2020-10-11' of git://git.kernel.org/pub/scm/linux/kerne... (diff) | |
parent | pipe: Fix memory leaks in create_pipe_files() (diff) | |
download | linux-5b697f86f9f136d200c9827d6eca0437b7eb96cf.tar.xz linux-5b697f86f9f136d200c9827d6eca0437b7eb96cf.zip |
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()
Diffstat (limited to 'fs/pipe.c')
-rw-r--r-- | fs/pipe.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/fs/pipe.c b/fs/pipe.c index 117db82b10af..0ac197658a2d 100644 --- a/fs/pipe.c +++ b/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, "", |