summaryrefslogtreecommitdiffstats
path: root/fs/squashfs/block.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/squashfs/block.c')
-rw-r--r--fs/squashfs/block.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/squashfs/block.c b/fs/squashfs/block.c
index 581ce95193..2dc730800f 100644
--- a/fs/squashfs/block.c
+++ b/fs/squashfs/block.c
@@ -321,7 +321,7 @@ int squashfs_read_data(struct super_block *sb, u64 index, int length,
TRACE("Block @ 0x%llx, %scompressed size %d\n", index - 2,
compressed ? "" : "un", length);
}
- if (length < 0 || length > output->length ||
+ if (length <= 0 || length > output->length ||
(index + length) > msblk->bytes_used) {
res = -EIO;
goto out;