diff options
author | Patrick Georgi <patrick@georgi-clan.de> | 2014-11-17 08:45:02 +0100 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2014-11-18 08:25:43 +0100 |
commit | 04f68c1cf174b075645500437058862b9a3ba169 (patch) | |
tree | 697b3215a27f649e86c4a4789eca852f7c18d9b0 /src/soc/intel/baytrail | |
parent | a0158125e1533b8985c6326213af148e4f21fa0b (diff) |
baytrail: fix range check
Change-Id: I59d42cd451997e141e02d99a62b84a7a2201eb31
Found-by: Coverity Scan
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: http://review.coreboot.org/7500
Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Tested-by: build bot (Jenkins)
Diffstat (limited to 'src/soc/intel/baytrail')
-rw-r--r-- | src/soc/intel/baytrail/gfx.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/soc/intel/baytrail/gfx.c b/src/soc/intel/baytrail/gfx.c index 9d4768f65a..5650d0d1f9 100644 --- a/src/soc/intel/baytrail/gfx.c +++ b/src/soc/intel/baytrail/gfx.c @@ -24,6 +24,7 @@ #include <device/pci.h> #include <device/pci_ids.h> #include <reg_script.h> +#include <stdlib.h> #include <baytrail/gfx.h> #include <baytrail/iosf.h> @@ -49,7 +50,7 @@ static void gfx_lock_pcbase(device_t dev) gms = pci_read_config32(dev, GGC) & GGC_GSM_SIZE_MASK; gms >>= 3; - if (gms > sizeof(gms_size_map)) + if (gms > ARRAY_SIZE(gms_size_map)) return; gmsize = gms_size_map[gms]; |