arm-trusted-firmware/drivers/arm/gic/v2
johpow01 20d384978b Fix casting bug in gicv2_main.c
In the function gicv2_set_spi_routing, the signed value proc_num is cast
to unsigned int before being compared to other unsigned values in two
assert calls.  The value proc_num can be a negative value, and once the
negative value is cast to unsigned it becomes a very large number which
will trigger the assert.  This patch changes the assert cast so that the
unsigned values are cast to signed instead, keeping the same functionality
but allowing proc_num to be negative.

This bug can be seen when running the SDEI RM_ANY routing mode test in
TFTF on the Juno platform.

This patch also makes the usage of the proc_num variable in other gicv2
functions more clear.

Signed-off-by: John Powell <john.powell@arm.com>
Change-Id: If1b98eebb00bd9b73862e5e995e5e68c168170a6
2020-10-10 07:14:44 +00:00
..
gicdv2_helpers.c TF-A GICv2 driver: Introduce makefile 2020-07-20 16:44:34 +00:00
gicv2.mk TF-A GICv2 driver: Introduce makefile 2020-07-20 16:44:34 +00:00
gicv2_helpers.c Coverity: remove unnecessary header file includes 2020-02-04 10:23:51 -06:00
gicv2_main.c Fix casting bug in gicv2_main.c 2020-10-10 07:14:44 +00:00
gicv2_private.h Sanitise includes across codebase 2019-01-04 10:43:17 +00:00