X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=convert%2Fsource-ext2.c;h=a2af1212f21bcfab3e091a97cc5e01e8885350d8;hb=e02049d964e77d22348bf940a7027a1aff558f18;hp=e5c2a9436b239a482426358906a14fdc683f451e;hpb=26072f584d347ef2d471c02fbe27dbfedd606ac4;p=platform%2Fupstream%2Fbtrfs-progs.git diff --git a/convert/source-ext2.c b/convert/source-ext2.c index e5c2a94..a2af121 100644 --- a/convert/source-ext2.c +++ b/convert/source-ext2.c @@ -95,6 +95,7 @@ static int ext2_open_fs(struct btrfs_convert_context *cctx, const char *name) return 0; fail: ext2fs_close(ext2_fs); + ext2fs_free(ext2_fs); return -1; } @@ -179,6 +180,7 @@ static void ext2_close_fs(struct btrfs_convert_context *cctx) cctx->volume_name = NULL; } ext2fs_close(cctx->fs_data); + ext2fs_free(cctx->fs_data); } static u8 ext2_filetype_conversion_table[EXT2_FT_MAX] = { @@ -308,8 +310,8 @@ static int ext2_create_file_extents(struct btrfs_trans_handle *trans, if (ret) goto fail; if ((convert_flags & CONVERT_FLAG_INLINE_DATA) && data.first_block == 0 - && data.num_blocks > 0 - && inode_size <= BTRFS_MAX_INLINE_DATA_SIZE(root)) { + && data.num_blocks > 0 && inode_size < sectorsize + && inode_size <= BTRFS_MAX_INLINE_DATA_SIZE(root->fs_info)) { u64 num_bytes = data.num_blocks * sectorsize; u64 disk_bytenr = data.disk_block * sectorsize; u64 nbytes; @@ -420,8 +422,7 @@ static int ext2_xattr_check_entry(struct ext2_ext_attr_entry *entry, { size_t value_size = entry->e_value_size; - if (entry->e_value_block != 0 || value_size > size || - entry->e_value_offs + value_size > size) + if (value_size > size || entry->e_value_offs + value_size > size) return -EIO; return 0; }