Merge branch 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa...
[cascardo/linux.git] / fs / hfsplus / super.c
index a513d2d..593af2f 100644 (file)
@@ -131,9 +131,10 @@ static int hfsplus_system_write_inode(struct inode *inode)
        hfsplus_inode_write_fork(inode, fork);
        if (tree) {
                int err = hfs_btree_write(tree);
+
                if (err) {
                        pr_err("b-tree write err: %d, ino %lu\n",
-                                       err, inode->i_ino);
+                              err, inode->i_ino);
                        return err;
                }
        }
@@ -514,7 +515,9 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent)
        err = hfs_find_init(sbi->cat_tree, &fd);
        if (err)
                goto out_put_root;
-       hfsplus_cat_build_key(sb, fd.search_key, HFSPLUS_ROOT_CNID, &str);
+       err = hfsplus_cat_build_key(sb, fd.search_key, HFSPLUS_ROOT_CNID, &str);
+       if (unlikely(err < 0))
+               goto out_put_root;
        if (!hfs_brec_read(&fd, &entry, sizeof(entry))) {
                hfs_find_exit(&fd);
                if (entry.type != cpu_to_be16(HFSPLUS_FOLDER))