diff --git a/fs/ext4/dev.c b/fs/ext4/dev.c index ee84d3fbe182675582c546de8b4bf4f3ad78fe02..ae2ba6a9015c8bc3bd15cef9ca59a82680ddce33 100644 --- a/fs/ext4/dev.c +++ b/fs/ext4/dev.c @@ -60,9 +60,8 @@ int ext4fs_devread(lbaint_t sector, int byte_offset, int byte_len, char *buf) } /* Check partition boundaries */ - if ((sector < 0) || - ((sector + ((byte_offset + byte_len - 1) >> log2blksz)) - >= part_info->size)) { + if ((sector + ((byte_offset + byte_len - 1) >> log2blksz)) + >= part_info->size) { printf("%s read outside partition " LBAFU "\n", __func__, sector); return 0; diff --git a/fs/ext4/ext4fs.c b/fs/ext4/ext4fs.c index 7187dcfb0565566f0f778bd2191df7093a19a2e1..081509dbb4db8927b6a8fa26342c39be8bb22284 100644 --- a/fs/ext4/ext4fs.c +++ b/fs/ext4/ext4fs.c @@ -71,7 +71,7 @@ int ext4fs_read_file(struct ext2fs_node *node, loff_t pos, blockcnt = lldiv(((len + pos) + blocksize - 1), blocksize); for (i = lldiv(pos, blocksize); i < blockcnt; i++) { - lbaint_t blknr; + long int blknr; int blockoff = pos - (blocksize * i); int blockend = blocksize; int skipfirst = 0;