Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 211586
b: refs/heads/master
c: ee52716
h: refs/heads/master
v: v3
  • Loading branch information
Jeff Mahoney authored and Christoph Hellwig committed Oct 14, 2010
1 parent a401da9 commit 2221057
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 40de9a7cebc4e0b23cd6863c84c2279f0ccadebb
refs/heads/master: ee52716245877b821f5ddbb3ace85b73084fb450
11 changes: 9 additions & 2 deletions trunk/fs/hfsplus/btree.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,16 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id)
goto free_tree;
tree->inode = inode;

if (!HFSPLUS_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))
goto free_tree;
goto free_inode;

/* Load the header */
head = (struct hfs_btree_header_rec *)(kmap(page) + sizeof(struct hfs_bnode_desc));
Expand Down Expand Up @@ -89,8 +95,9 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id)
fail_page:
tree->inode->i_mapping->a_ops = &hfsplus_aops;
page_cache_release(page);
free_tree:
free_inode:
iput(tree->inode);
free_tree:
kfree(tree);
return NULL;
}
Expand Down

0 comments on commit 2221057

Please sign in to comment.