mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 15:14:43 +00:00
addrmap: Fix off by one in addrmap_set_entry()
The > comparison needs to be changed to >= to prevent an out of bounds write on th next line. Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
c594b43022
commit
7dd06b1621
1 changed files with 1 additions and 1 deletions
|
@ -59,7 +59,7 @@ void *addrmap_phys_to_virt(phys_addr_t paddr)
|
|||
void addrmap_set_entry(unsigned long vaddr, phys_addr_t paddr,
|
||||
phys_size_t size, int idx)
|
||||
{
|
||||
if (idx > CONFIG_SYS_NUM_ADDR_MAP)
|
||||
if (idx >= CONFIG_SYS_NUM_ADDR_MAP)
|
||||
return;
|
||||
|
||||
address_map[idx].vaddr = vaddr;
|
||||
|
|
Loading…
Reference in a new issue