aboutsummaryrefslogtreecommitdiffstats
path: root/fs/hfs
diff options
context:
space:
mode:
authorJeff Mahoney <jeffm@suse.com>2013-05-24 18:55:16 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-05-24 19:22:51 -0400
commitfb09c3733a94b5f1dba50359d09c9e217c763fb9 (patch)
treed9ed1d68d337e6e495968b1920598dd8f8b7ff80 /fs/hfs
parent28ccddf7952c496df2a51ce5aee4f2a058a98bab (diff)
hfs: avoid crash in hfs_bnode_create
Commit 634725a92938 ("hfs: cleanup HFS+ prints") removed the BUG_ON in hfs_bnode_create in hfsplus. This patch removes it from the hfs version and avoids an fsfuzzer crash. Signed-off-by: Jeff Mahoney <jeffm@suse.com> Acked-by: Jeff Mahoney <jeffm@suse.com> Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Vyacheslav Dubeyko <slava@dubeyko.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/hfs')
-rw-r--r--fs/hfs/bnode.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/hfs/bnode.c b/fs/hfs/bnode.c
index f3b1a15ccd59..d3fa6bd9503e 100644
--- a/fs/hfs/bnode.c
+++ b/fs/hfs/bnode.c
@@ -415,7 +415,11 @@ struct hfs_bnode *hfs_bnode_create(struct hfs_btree *tree, u32 num)
415 spin_lock(&tree->hash_lock); 415 spin_lock(&tree->hash_lock);
416 node = hfs_bnode_findhash(tree, num); 416 node = hfs_bnode_findhash(tree, num);
417 spin_unlock(&tree->hash_lock); 417 spin_unlock(&tree->hash_lock);
418 BUG_ON(node); 418 if (node) {
419 pr_crit("new node %u already hashed?\n", num);
420 WARN_ON(1);
421 return node;
422 }
419 node = __hfs_bnode_create(tree, num); 423 node = __hfs_bnode_create(tree, num);
420 if (!node) 424 if (!node)
421 return ERR_PTR(-ENOMEM); 425 return ERR_PTR(-ENOMEM);