diff options
author | Jerzy Szczepkowski <js189202@zodiac.mimuw.edu.pl> | 2004-07-06 09:20:10 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-07-06 09:20:10 -0700 |
commit | c105abb358d74cc256736ab3e9ef760544a525f5 (patch) | |
tree | 60e6110c1331d1d378838750885b5240f955a23d /fs | |
parent | 6173a1137439f0b998c4a2a945fd07b2b873510d (diff) | |
download | history-c105abb358d74cc256736ab3e9ef760544a525f5.tar.gz |
[PATCH] Fix memory leak in epoll
There was a memory leak in epoll.
The reference count (d_count) of the struct dentry of a new epoll-fd was
set to TWO. (new_inode() assigned ONE, than ep_getfd() incremented it by
dget()). There was only ONE reference to this dentry, so struct dentry and
struct inode were never freed.
Signed-off-by: Davide Libenzi <davidel@xmailserver.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/eventpoll.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/eventpoll.c b/fs/eventpoll.c index a05a3ce255b81d..c81ddcd31abae1 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c @@ -716,7 +716,7 @@ static int ep_getfd(int *efd, struct inode **einode, struct file **efile) dentry->d_op = &eventpollfs_dentry_operations; d_add(dentry, inode); file->f_vfsmnt = mntget(eventpoll_mnt); - file->f_dentry = dget(dentry); + file->f_dentry = dentry; file->f_mapping = inode->i_mapping; file->f_pos = 0; |