aboutsummaryrefslogtreecommitdiff
path: root/fs/hfs
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2009-11-18 10:09:55 +1000
committerDave Airlie <airlied@redhat.com>2009-11-18 10:09:55 +1000
commit46557bef3f3834ac33031c7be27d39d90d507442 (patch)
tree5cfc4a9e1263fe0a15e516ca9695ee2f9b8899e4 /fs/hfs
parent4efc50d697ed8d9a91f0005d922907a7b6c9290d (diff)
parentd91d8a3f88059d93e34ac70d059153ec69a9ffc7 (diff)
Merge branch 'drm-core-next' of ../linux-2.6 into drm-next
Diffstat (limited to 'fs/hfs')
-rw-r--r--fs/hfs/btree.c5
-rw-r--r--fs/hfs/mdb.c6
2 files changed, 7 insertions, 4 deletions
diff --git a/fs/hfs/btree.c b/fs/hfs/btree.c
index 9b9d6395bad..052f214ea6f 100644
--- a/fs/hfs/btree.c
+++ b/fs/hfs/btree.c
@@ -58,6 +58,11 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id, btree_keycmp ke
}
unlock_new_inode(tree->inode);
+ if (!HFS_I(tree->inode)->first_blocks) {
+ printk(KERN_ERR "hfs: invalid btree extent records (0 size).\n");
+ goto free_inode;
+ }
+
mapping = tree->inode->i_mapping;
page = read_mapping_page(mapping, 0, NULL);
if (IS_ERR(page))
diff --git a/fs/hfs/mdb.c b/fs/hfs/mdb.c
index 7b6165f25fb..8bbe03c3f6d 100644
--- a/fs/hfs/mdb.c
+++ b/fs/hfs/mdb.c
@@ -344,10 +344,8 @@ void hfs_mdb_put(struct super_block *sb)
brelse(HFS_SB(sb)->mdb_bh);
brelse(HFS_SB(sb)->alt_mdb_bh);
- if (HFS_SB(sb)->nls_io)
- unload_nls(HFS_SB(sb)->nls_io);
- if (HFS_SB(sb)->nls_disk)
- unload_nls(HFS_SB(sb)->nls_disk);
+ unload_nls(HFS_SB(sb)->nls_io);
+ unload_nls(HFS_SB(sb)->nls_disk);
free_pages((unsigned long)HFS_SB(sb)->bitmap, PAGE_SIZE < 8192 ? 1 : 0);
kfree(HFS_SB(sb));