diff options
author | Antonio Nino Diaz <antonio.ninodiaz@arm.com> | 2019-03-29 13:48:50 +0000 |
---|---|---|
committer | Antonio Nino Diaz <antonio.ninodiaz@arm.com> | 2019-04-02 14:52:55 +0100 |
commit | 5db5930bafe00db095c2aed150fdbc45059b692a (patch) | |
tree | 92ffe2fe41ae755c00514edd5c254248c17a9efb | |
parent | 0a4bf763f3e5b2f67b0d5798a40fb9d0caefd554 (diff) |
SPM: Ignore empty regions in resource description
Instead of letting the code run until another error is reached, return
early.
Change-Id: I6277a8c65101d3e39b0540099c2a3063584a7dbd
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
-rw-r--r-- | services/std_svc/spm/spm_xlat.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/services/std_svc/spm/spm_xlat.c b/services/std_svc/spm/spm_xlat.c index 57ad7424..5f830965 100644 --- a/services/std_svc/spm/spm_xlat.c +++ b/services/std_svc/spm/spm_xlat.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2018-2019, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -159,6 +159,11 @@ static void map_rdmem(sp_context_t *sp_ctx, struct sp_rd_sect_mem_region *rdmem) unsigned int memtype = rdmem->attr & RD_MEM_MASK; + if (rd_size == 0U) { + VERBOSE("Memory region '%s' is empty. Ignored.\n", rdmem->name); + return; + } + VERBOSE("Adding memory region '%s'\n", rdmem->name); mmap.granularity = REGION_DEFAULT_GRANULARITY; |