]> err.no Git - linux-2.6/blobdiff - fs/hfsplus/super.c
[PATCH] parport: add NetMOS 9805 support
[linux-2.6] / fs / hfsplus / super.c
index 5f8044664a3c4e772e9590344499a79081c946c8..d55ad67b8e4238e3625f2139b78b353858337657 100644 (file)
@@ -208,7 +208,9 @@ static void hfsplus_write_super(struct super_block *sb)
 static void hfsplus_put_super(struct super_block *sb)
 {
        dprint(DBG_SUPER, "hfsplus_put_super\n");
-       if (!(sb->s_flags & MS_RDONLY)) {
+       if (!sb->s_fs_info)
+               return;
+       if (!(sb->s_flags & MS_RDONLY) && HFSPLUS_SB(sb).s_vhdr) {
                struct hfsplus_vh *vhdr = HFSPLUS_SB(sb).s_vhdr;
 
                vhdr->modify_date = hfsp_now2mt();
@@ -226,6 +228,8 @@ static void hfsplus_put_super(struct super_block *sb)
        brelse(HFSPLUS_SB(sb).s_vhbh);
        if (HFSPLUS_SB(sb).nls)
                unload_nls(HFSPLUS_SB(sb).nls);
+       kfree(sb->s_fs_info);
+       sb->s_fs_info = NULL;
 }
 
 static int hfsplus_statfs(struct super_block *sb, struct kstatfs *buf)