summaryrefslogtreecommitdiff
path: root/services/std_svc
diff options
context:
space:
mode:
authorOlivier Deprez <olivier.deprez@arm.com>2023-07-25 15:32:54 +0200
committerTrustedFirmware Code Review <review@review.trustedfirmware.org>2023-07-25 15:32:54 +0200
commitabe80629fc8970ce660e44e51d1475f31014bf4c (patch)
tree9b067ac9a83174dd530fbf4a5da00d760508439a /services/std_svc
parentfbc90e0fdd33d9cdfd06a8829e00693d5ec0deb0 (diff)
parent1dd79f9e2316e5a7a78b0ad5a34ec50288338e6f (diff)
Merge "fix(el3-spmc): fix incorrect CASSERT" into integration
Diffstat (limited to 'services/std_svc')
-rw-r--r--services/std_svc/spm/el3_spmc/spmc_shared_mem.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/services/std_svc/spm/el3_spmc/spmc_shared_mem.c b/services/std_svc/spm/el3_spmc/spmc_shared_mem.c
index 5c3d580ce..5263c047d 100644
--- a/services/std_svc/spm/el3_spmc/spmc_shared_mem.c
+++ b/services/std_svc/spm/el3_spmc/spmc_shared_mem.c
@@ -743,10 +743,12 @@ spmc_validate_mtd_start(struct ffa_mtd *desc, uint32_t ffa_version,
/*
* Overflow is impossible: the arithmetic happens in at least 64-bit
* precision, but all of the operands are bounded by UINT32_MAX, and
- * ((2^32 - 1)^2 + (2^32 - 1) + (2^32 - 1)) = ((2^32 - 1) * (2^32 + 1))
+ * ((2^32 - 1) * (2^32 - 1) + (2^32 - 1) + (2^32 - 1))
+ * = ((2^32 - 1) * ((2^32 - 1) + 1 + 1))
+ * = ((2^32 - 1) * (2^32 + 1))
* = (2^64 - 1).
*/
- CASSERT(sizeof(desc->emad_count == 4), assert_emad_count_max_too_large);
+ CASSERT(sizeof(desc->emad_count) == 4, assert_emad_count_max_too_large);
emad_end = (desc->emad_count * (unsigned long long)emad_size) +
(unsigned long long)sizeof(struct ffa_comp_mrd) +
(unsigned long long)emad_offset;