diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 9ab845e..69715e5 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -380,9 +380,9 @@ static int __ext4_check_blockref(const char *function, struct inode *inode, if (unlikely(*bref >= maxblocks)) { ext4_error(inode->i_sb, function, "block reference %u >= max (%u) " - "in inode #%lu, offset=%u", + "in inode #%lu, offset=%i", *bref, maxblocks, - inode->i_ino, bref-p); + inode->i_ino, (int)(bref-p)); return -EIO; } bref++; @@ -453,8 +453,10 @@ static Indirect *ext4_get_branch(struct inode *inode, int depth, goto failure; } /* validate block references */ - if (ext4_check_indirect_blockref(inode, bh)) + if (ext4_check_indirect_blockref(inode, bh)) { + put_bh(bh); goto failure; + } } add_chain(++p, bh, (__le32 *)bh->b_data + *++offsets);