Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5b697f8

Browse files
committed
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()
2 parentsc120ec1 +8a018eb commit5b697f8

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

‎fs/pipe.c‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -894,19 +894,18 @@ int create_pipe_files(struct file **res, int flags)
894894
{
895895
structinode*inode=get_pipe_inode();
896896
structfile*f;
897+
interror;
897898

898899
if (!inode)
899900
return-ENFILE;
900901

901902
if (flags&O_NOTIFICATION_PIPE) {
902-
#ifdefCONFIG_WATCH_QUEUE
903-
if (watch_queue_init(inode->i_pipe)<0) {
903+
error=watch_queue_init(inode->i_pipe);
904+
if (error) {
905+
free_pipe_info(inode->i_pipe);
904906
iput(inode);
905-
return-ENOMEM;
907+
returnerror;
906908
}
907-
#else
908-
return-ENOPKG;
909-
#endif
910909
}
911910

912911
f=alloc_file_pseudo(inode,pipe_mnt,"",

‎include/linux/watch_queue.h‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,12 @@ static inline void remove_watch_list(struct watch_list *wlist, u64 id)
122122
*/
123123
#definewatch_sizeof(STRUCT) (sizeof(STRUCT) << WATCH_INFO_LENGTH__SHIFT)
124124

125+
#else
126+
staticinlineintwatch_queue_init(structpipe_inode_info*pipe)
127+
{
128+
return-ENOPKG;
129+
}
130+
125131
#endif
126132

127133
#endif/* _LINUX_WATCH_QUEUE_H */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp