summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/northbridge/amd/amdfam10/ht_config.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/northbridge/amd/amdfam10/ht_config.c b/src/northbridge/amd/amdfam10/ht_config.c
index 4810b99b59..8499dbb623 100644
--- a/src/northbridge/amd/amdfam10/ht_config.c
+++ b/src/northbridge/amd/amdfam10/ht_config.c
@@ -14,6 +14,7 @@
*/
#include <stdint.h>
+#include <console/console.h>
#include <device/device.h>
#include <device/pci_ops.h>
@@ -127,6 +128,10 @@ u32 get_io_addr_index(u32 nodeid, u32 linkn)
u32 index;
for (index = 0; index < 256; index++) {
+
+ if (index + 4 >= ARRAY_SIZE(sysconf.conf_io_addrx))
+ die("Error! Out of bounds read in %s:%s\n", __FILE__, __func__);
+
if (sysconf.conf_io_addrx[index+4] == 0) {
sysconf.conf_io_addr[index+4] = (nodeid & 0x3f);
sysconf.conf_io_addrx[index+4] = 1 | ((linkn & 0x7)<<4);
@@ -142,6 +147,10 @@ u32 get_mmio_addr_index(u32 nodeid, u32 linkn)
u32 index;
for (index = 0; index < 64; index++) {
+
+ if (index + 8 >= ARRAY_SIZE(sysconf.conf_mmio_addrx))
+ die("Error! Out of bounds read in %s:%s\n", __FILE__, __func__);
+
if (sysconf.conf_mmio_addrx[index+8] == 0) {
sysconf.conf_mmio_addr[index+8] = (nodeid & 0x3f);
sysconf.conf_mmio_addrx[index+8] = 1 | ((linkn & 0x7)<<4);