[qspi][bio][debug] Fixed signed/unsigned compare warning

This commit is contained in:
Gurjant Kalsi
2015-10-16 19:07:32 -07:00
parent db1ff1983d
commit 8d7fcb24c6

View File

@@ -291,7 +291,7 @@ static bool is_valid_block(bdev_t *device, bnum_t block_num, uint8_t* pattern,
uint8_t *block_contents = malloc(device->block_size);
ssize_t n_bytes = device->read_block(device, block_contents, block_num, 1);
if (n_bytes != device->block_size) {
if (n_bytes < 0 || n_bytes != (ssize_t)device->block_size) {
free(block_contents);
return false;
}