arc: fix off-by-one in _is_in_region()
Similar issue to what was fixed earlier in the MPUv3 code. start + size should be <= r_addr_end. Fixes a problem where the last byte of an MPU region is incorrectly reported as out-of-bounds. Fixes: #15131 Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
parent
4ea404d9bf
commit
29095ac135
1 changed files with 1 additions and 1 deletions
|
@ -118,7 +118,7 @@ static inline bool _is_in_region(u32_t r_index, u32_t start, u32_t size)
|
|||
r_size_lshift = (r_size_lshift & 0x3) | ((r_size_lshift >> 7) & 0x1C);
|
||||
r_addr_end = r_addr_start + (1 << (r_size_lshift + 1));
|
||||
|
||||
if (start >= r_addr_start && (start + size) < r_addr_end) {
|
||||
if (start >= r_addr_start && (start + size) <= r_addr_end) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue