summaryrefslogtreecommitdiffstats
path: root/ArmPkg/Drivers/ArmGic/GicV3
diff options
context:
space:
mode:
authorHeyi Guo <heyi.guo@linaro.org>2016-04-23 22:39:59 +0800
committerArd Biesheuvel <ard.biesheuvel@linaro.org>2016-04-25 13:28:40 +0200
commit599f004b278f597dcfd02a56a72d9393b5f0c55a (patch)
tree8a792139a00f3373036da525a67d349e00ef59aa /ArmPkg/Drivers/ArmGic/GicV3
parentfa8ee0ad6dbb22bb9962c3e32c091f29c2e0d5d8 (diff)
downloadedk2-599f004b278f597dcfd02a56a72d9393b5f0c55a.tar.gz
edk2-599f004b278f597dcfd02a56a72d9393b5f0c55a.tar.bz2
edk2-599f004b278f597dcfd02a56a72d9393b5f0c55a.zip
ArmPkg/Gic: Fix boundary checking bug
mGicNumInterrupts is the total number of interrupts, so the interrupt ID equal to mGicNumInterrupts is also invalid. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Heyi Guo <heyi.guo@linaro.org> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Diffstat (limited to 'ArmPkg/Drivers/ArmGic/GicV3')
-rw-r--r--ArmPkg/Drivers/ArmGic/GicV3/ArmGicV3Dxe.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ArmPkg/Drivers/ArmGic/GicV3/ArmGicV3Dxe.c b/ArmPkg/Drivers/ArmGic/GicV3/ArmGicV3Dxe.c
index 4afa3d5a09..50fa56262e 100644
--- a/ArmPkg/Drivers/ArmGic/GicV3/ArmGicV3Dxe.c
+++ b/ArmPkg/Drivers/ArmGic/GicV3/ArmGicV3Dxe.c
@@ -40,7 +40,7 @@ GicV3EnableInterruptSource (
IN HARDWARE_INTERRUPT_SOURCE Source
)
{
- if (Source > mGicNumInterrupts) {
+ if (Source >= mGicNumInterrupts) {
ASSERT(FALSE);
return EFI_UNSUPPORTED;
}
@@ -67,7 +67,7 @@ GicV3DisableInterruptSource (
IN HARDWARE_INTERRUPT_SOURCE Source
)
{
- if (Source > mGicNumInterrupts) {
+ if (Source >= mGicNumInterrupts) {
ASSERT(FALSE);
return EFI_UNSUPPORTED;
}
@@ -96,7 +96,7 @@ GicV3GetInterruptSourceState (
IN BOOLEAN *InterruptState
)
{
- if (Source > mGicNumInterrupts) {
+ if (Source >= mGicNumInterrupts) {
ASSERT(FALSE);
return EFI_UNSUPPORTED;
}
@@ -124,7 +124,7 @@ GicV3EndOfInterrupt (
IN HARDWARE_INTERRUPT_SOURCE Source
)
{
- if (Source > mGicNumInterrupts) {
+ if (Source >= mGicNumInterrupts) {
ASSERT(FALSE);
return EFI_UNSUPPORTED;
}