12 Mar
2020
12 Mar
'20
11:30 a.m.
Hi yadong,
static int alloc_free_io_port_range(vmm_io_port_list_t *io_list, ioport_range_t *io_range) { uint16_t free_port_addr = io_list->alloc_addr; if (free_port_addr + io_range->size < free_port_addr) { /* Possible overflow */ return -1; } io_list->alloc_addr += io_range->size; io_range->start = free_port_addr; io_range->end = free_port_addr + io_range->size; return 0; } I think "io_range->end = free_port_addr + io_range->size;" should change to "io_range->end = free_port_addr + io_range->size - 1;" ?
Thanks for catching this! I've submitted a PR on Github [1] which resolves this issue. Regards, Damon [1] https://github.com/SEL4PROJ/seL4_projects_libs/pull/10