diff options
author | Soby Mathew <soby.mathew@arm.com> | 2020-01-24 12:53:18 +0000 |
---|---|---|
committer | TrustedFirmware Code Review <review@review.trustedfirmware.org> | 2020-01-24 12:53:18 +0000 |
commit | 064d3f64180442c2dbde9805b2ef8c72b93ed4e0 (patch) | |
tree | 8e08141265ddc1866c23d94a02d1512faeb488a4 /lib | |
parent | 5f3ed6aaedac18d37980da13fd0d5ec49ef686fb (diff) | |
parent | c3fc368a5a3c0f05ea7258582ff15391ade5dbd5 (diff) | |
download | platform_external_arm-trusted-firmware-064d3f64180442c2dbde9805b2ef8c72b93ed4e0.tar.gz platform_external_arm-trusted-firmware-064d3f64180442c2dbde9805b2ef8c72b93ed4e0.tar.bz2 platform_external_arm-trusted-firmware-064d3f64180442c2dbde9805b2ef8c72b93ed4e0.zip |
Merge "xlat_tables_v2: simplify end address checks in mmap_add_region_check()" into integration
Diffstat (limited to 'lib')
-rw-r--r-- | lib/xlat_tables_v2/xlat_tables_core.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/xlat_tables_v2/xlat_tables_core.c b/lib/xlat_tables_v2/xlat_tables_core.c index 3c0865b81..b2259e5f3 100644 --- a/lib/xlat_tables_v2/xlat_tables_core.c +++ b/lib/xlat_tables_v2/xlat_tables_core.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2017-2020, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -688,10 +688,10 @@ static int mmap_add_region_check(const xlat_ctx_t *ctx, const mmap_region_t *mm) if ((base_pa > end_pa) || (base_va > end_va)) return -ERANGE; - if ((base_va + (uintptr_t)size - (uintptr_t)1) > ctx->va_max_address) + if (end_va > ctx->va_max_address) return -ERANGE; - if ((base_pa + (unsigned long long)size - 1ULL) > ctx->pa_max_address) + if (end_pa > ctx->pa_max_address) return -ERANGE; /* Check that there is space in the ctx->mmap array */ |