diff --git a/fs/hfsplus/super.c b/fs/hfsplus/super.c index 1a34e20ac995..9646cde02010 100644 --- a/fs/hfsplus/super.c +++ b/fs/hfsplus/super.c @@ -539,8 +539,10 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent) if (err) goto out_put_root; err = hfsplus_cat_build_key(sb, fd.search_key, HFSPLUS_ROOT_CNID, &str); - if (unlikely(err < 0)) + if (unlikely(err < 0)) { + hfs_find_exit(&fd); goto out_put_root; + } if (!hfsplus_brec_read_cat(&fd, &entry)) { hfs_find_exit(&fd); if (entry.type != cpu_to_be16(HFSPLUS_FOLDER)) {