From 9c7d73ca3f5b2985cb0f498038a746bcc0f2cac7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Mon, 9 Sep 2013 09:23:19 +0300 Subject: AMD sb800 sb900: Fix corruption of a global ramstage variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A late for loop may reference over the current array allocation and corrupt an unrelated global variable. As a quick fix bumb the size of the array allocation uniformly to 6. Change-Id: Ib067fdf077e091d13e32cc3a8e4a0b713d19bcc2 Signed-off-by: Kyösti Mälkki Reviewed-on: http://review.coreboot.org/3914 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin Reviewed-by: Bruce Griffith --- src/mainboard/amd/bimini_fam10/get_bus_conf.c | 7 +++---- src/mainboard/amd/bimini_fam10/irq_tables.c | 2 +- src/mainboard/amd/bimini_fam10/mptable.c | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) (limited to 'src/mainboard/amd/bimini_fam10') diff --git a/src/mainboard/amd/bimini_fam10/get_bus_conf.c b/src/mainboard/amd/bimini_fam10/get_bus_conf.c index 52edad104f..c4924d4c58 100644 --- a/src/mainboard/amd/bimini_fam10/get_bus_conf.c +++ b/src/mainboard/amd/bimini_fam10/get_bus_conf.c @@ -33,7 +33,7 @@ */ int bus_isa; u8 bus_rs780[11]; -u8 bus_sb800[3]; +u8 bus_sb800[6]; u32 apicid_sb800; /* @@ -84,9 +84,8 @@ void get_bus_conf(void) sbdn_rs780 = sysconf.sbdn; sbdn_sb800 = 0; - for (i = 0; i < 3; i++) { - bus_sb800[i] = 0; - } + memset(bus_sb800, 0, sizeof(bus_sb800)); + for (i = 0; i < ARRAY_SIZE(bus_rs780); i++) { bus_rs780[i] = 0; } diff --git a/src/mainboard/amd/bimini_fam10/irq_tables.c b/src/mainboard/amd/bimini_fam10/irq_tables.c index 18cb2432e3..0d5027d6eb 100644 --- a/src/mainboard/amd/bimini_fam10/irq_tables.c +++ b/src/mainboard/amd/bimini_fam10/irq_tables.c @@ -45,7 +45,7 @@ static void write_pirq_info(struct irq_info *pirq_info, u8 bus, u8 devfn, extern u8 bus_isa; extern u8 bus_rs780[8]; -extern u8 bus_sb800[2]; +extern u8 bus_sb800[6]; extern unsigned long sbdn_sb800; unsigned long write_pirq_routing_table(unsigned long addr) diff --git a/src/mainboard/amd/bimini_fam10/mptable.c b/src/mainboard/amd/bimini_fam10/mptable.c index 4ad4fd434f..792fa41ffe 100644 --- a/src/mainboard/amd/bimini_fam10/mptable.c +++ b/src/mainboard/amd/bimini_fam10/mptable.c @@ -28,7 +28,7 @@ extern int bus_isa; extern u8 bus_rs780[11]; -extern u8 bus_sb800[2]; +extern u8 bus_sb800[6]; extern u32 apicid_sb800; extern u32 bus_type[256]; extern u32 sbdn_rs780; -- cgit v1.2.3