vserver 2.0 rc7
[linux-2.6.git] / fs / hfs / mdb.c
index 4efb640..217e32f 100644 (file)
@@ -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;
 }