summaryrefslogtreecommitdiffstats
path: root/fs/hfs/mdb.c
diff options
context:
space:
mode:
authorColin Leroy <colin@colino.net>2005-05-01 08:59:16 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-01 08:59:16 -0700
commit945b092011c6af71a0107be96e119c8c08776f3f (patch)
tree7e0d6b79250aa2a5d0b51e9368e89b5f92cfe88e /fs/hfs/mdb.c
parent954d3e95369cf73b4bc1e570729f68264a0e6fe0 (diff)
downloadop-kernel-dev-945b092011c6af71a0107be96e119c8c08776f3f.zip
op-kernel-dev-945b092011c6af71a0107be96e119c8c08776f3f.tar.gz
[PATCH] hfs, hfsplus: don't leak s_fs_info and fix an oops
This patch fixes the leak of sb->s_fs_info in both the HFS and HFS+ modules. In addition to this, it fixes an oops happening when trying to mount a non-hfsplus filesystem using hfsplus. This patch is from Roman Zippel, based off patches sent by myself. Signed-off-by: Colin Leroy <colin@colino.net> Signed-off-by: Roman Zippel <zippel@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/hfs/mdb.c')
-rw-r--r--fs/hfs/mdb.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/hfs/mdb.c b/fs/hfs/mdb.c
index 4efb640..217e32f 100644
--- a/fs/hfs/mdb.c
+++ b/fs/hfs/mdb.c
@@ -333,6 +333,8 @@ void hfs_mdb_close(struct super_block *sb)
* Release the resources associated with the in-core MDB. */
void hfs_mdb_put(struct super_block *sb)
{
+ if (!HFS_SB(sb))
+ return;
/* free the B-trees */
hfs_btree_close(HFS_SB(sb)->ext_tree);
hfs_btree_close(HFS_SB(sb)->cat_tree);
@@ -340,4 +342,7 @@ void hfs_mdb_put(struct super_block *sb)
/* free the buffers holding the primary and alternate MDBs */
brelse(HFS_SB(sb)->mdb_bh);
brelse(HFS_SB(sb)->alt_mdb_bh);
+
+ kfree(HFS_SB(sb));
+ sb->s_fs_info = NULL;
}
OpenPOWER on IntegriCloud