diff --git a/bsps/riscv/niosv/flash/altera_epcq_driver.c b/bsps/riscv/niosv/flash/altera_epcq_driver.c index 80ece7d5e6..0ebde57f03 100644 --- a/bsps/riscv/niosv/flash/altera_epcq_driver.c +++ b/bsps/riscv/niosv/flash/altera_epcq_driver.c @@ -834,9 +834,7 @@ static inline int 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 || - offset < 0 || - length < 0 + end_address > epcq_flash_info->data_end ) { return -EINVAL; }