Messages in this thread Patch in this message | | | Date | Fri, 3 Dec 2004 12:00:36 -0800 | From | Greg KH <> | Subject | [PATCH 2/3] sysfs: fix sysfs_dir_close memory leak |
| |
sysfs_dir_close did not free the "cursor" sysfs_dirent used for keeping track of position in the list of sysfs_dirent nodes. Consequently, doing a "find /sys" would leak a sysfs_dirent for each of the 1140 directories in my /sys tree, or about 36kB each time.
From: "Adam J. Richter" <adam@yggdrasil.com> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
--- 1.34/fs/sysfs/dir.c 2004-11-22 10:42:02 -08:00 +++ edited/fs/sysfs/dir.c 2004-12-03 10:42:51 -08:00 @@ -351,6 +351,8 @@ static int sysfs_dir_close(struct inode list_del_init(&cursor->s_sibling); up(&dentry->d_inode->i_sem); + release_sysfs_dirent(cursor); + return 0; } - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |