xlat: Change check in mmap_add and mmap_add_ctx()
Depending on the build flags it is possible that some of the memory
regions mapped in page table setup could have a size of 0. In this
case we simply want to do nothing but still wish to map the other
regions in the array. Therefore we cannot only use size == 0 as
the termination logic for the loop.

Since an attributes field with value 0 means that the region is
device memory, read only, secure and executable. Device memory
can't be executable, so this combination should never be used
and it is safe to use as a terminator value.

Therefore by changing the termination logic to use attributes
instead of size we prevent terminating the loop when we don't
intend to.

Change-Id: I92fc7f689ab08543497be6be4896dace2ed7b66a
Signed-off-by: Daniel Boulby <daniel.boulby@arm.com>
1 parent a4277cd commit 79621f0038b789de23ecc8891024f7cf6aa65999
@Daniel Boulby Daniel Boulby authored on 28 Aug 2018
Antonio Nino Diaz committed on 3 Oct 2018
Showing 2 changed files
View
lib/xlat_tables/xlat_tables_common.c
View
lib/xlat_tables_v2/xlat_tables_core.c