From 6c6297b200fc4c9df8b5bd35fcd4a48fa764c5c5 Mon Sep 17 00:00:00 2001 From: bp Date: Thu, 29 Jun 2000 01:12:47 +0000 Subject: Fix memory leakage on module unload. Spotted by: fixed INVARIANTS code --- sys/fs/msdosfs/msdosfs_denode.c | 10 ++++++++++ sys/fs/msdosfs/msdosfs_vfsops.c | 2 +- sys/fs/msdosfs/msdosfsmount.h | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) (limited to 'sys/fs') diff --git a/sys/fs/msdosfs/msdosfs_denode.c b/sys/fs/msdosfs/msdosfs_denode.c index b7bf2cb..4e237bf 100644 --- a/sys/fs/msdosfs/msdosfs_denode.c +++ b/sys/fs/msdosfs/msdosfs_denode.c @@ -110,6 +110,16 @@ msdosfs_init(vfsp) return (0); } +int +msdosfs_uninit(vfsp) + struct vfsconf *vfsp; +{ + + if (dehashtbl) + free(dehashtbl, M_MSDOSFSMNT); + return (0); +} + static struct denode * msdosfs_hashget(dev, dirclust, diroff) dev_t dev; diff --git a/sys/fs/msdosfs/msdosfs_vfsops.c b/sys/fs/msdosfs/msdosfs_vfsops.c index 84d8b7c..33b5cd7 100644 --- a/sys/fs/msdosfs/msdosfs_vfsops.c +++ b/sys/fs/msdosfs/msdosfs_vfsops.c @@ -981,7 +981,7 @@ static struct vfsops msdosfs_vfsops = { msdosfs_checkexp, msdosfs_vptofh, msdosfs_init, - vfs_stduninit, + msdosfs_uninit, vfs_stdextattrctl, }; diff --git a/sys/fs/msdosfs/msdosfsmount.h b/sys/fs/msdosfs/msdosfsmount.h index 59cc7c9..adcfad0 100644 --- a/sys/fs/msdosfs/msdosfsmount.h +++ b/sys/fs/msdosfs/msdosfsmount.h @@ -198,6 +198,7 @@ struct msdosfsmount { (1024 << ((pmp)->pm_BlkPerSec >> 2)) int msdosfs_init __P((struct vfsconf *vfsp)); +int msdosfs_uninit __P((struct vfsconf *vfsp)); int msdosfs_mountroot __P((void)); #endif /* _KERNEL */ -- cgit v1.1