X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=fs%2Fsquashfs%2Ffile.c;h=43d946617d2d4153b3c98aced83cffcf65ddd57e;hb=a38145abaae3f624e5eac17087f8bfa225a35c88;hp=6f5ef8d7e55acc0bb6b3fd9e3ce9b28e7b1ff697;hpb=fff3058708953ac958f059f3b5f2a7e018210bfd;p=sagit-ice-cold%2Fkernel_xiaomi_msm8998.git diff --git a/fs/squashfs/file.c b/fs/squashfs/file.c index 6f5ef8d7e55a..43d946617d2d 100644 --- a/fs/squashfs/file.c +++ b/fs/squashfs/file.c @@ -198,7 +198,11 @@ static long long read_indexes(struct super_block *sb, int n, } for (i = 0; i < blocks; i++) { - int size = le32_to_cpu(blist[i]); + int size = squashfs_block_size(blist[i]); + if (size < 0) { + err = size; + goto failure; + } block += SQUASHFS_COMPRESSED_SIZE_BLOCK(size); } n -= blocks; @@ -371,7 +375,7 @@ static int read_blocklist(struct inode *inode, int index, u64 *block) sizeof(size)); if (res < 0) return res; - return le32_to_cpu(size); + return squashfs_block_size(size); } /* Copy data into page cache */