OSDN Git Service

Merge 4.4.146 into android-4.4-p
[sagit-ice-cold/kernel_xiaomi_msm8998.git] / fs / squashfs / file.c
index 6f5ef8d..43d9466 100644 (file)
@@ -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  */