altera_epcq_controller_mod.c: Fix faulty read/write end address check.

In the Flash info structure, the field containing the end address of
the Flash storage is documented to be non-inclusive.

However, when this field is compared to the end address of a read or
write, which is also non-inclusive, it is considered an error that
these two values match, which is incorrect, as this would error out
on an attempt to fully read/write the last page.

Fix this by simply changing the >= comparison into a > one.
This commit is contained in:
Ari Sundholm 2020-11-06 14:45:02 +02:00
parent af1f8a20d4
commit 0b495b234c
1 changed files with 1 additions and 1 deletions

View File

@ -736,7 +736,7 @@ ALT_INLINE alt_32 static alt_epcq_validate_read_write_arguments
/* make sure start and end address is less then the end address of the flash */
if(
start_address >= epcq_flash_info->data_end ||
end_address >= epcq_flash_info->data_end ||
end_address > epcq_flash_info->data_end ||
offset < 0 ||
length < 0
)