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 #include #include +#include #include #include @@ -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];