From 4f9bf7e2fb7035725c2899db0d00d77007d9113c 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 hudson yangtze: 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. We missed these boards for commit 9c7d73ca because the arrays had been renamed. Change-Id: Iff2f2a0090d9302576bc72195d2a3f6fa37ce29a Signed-off-by: Kyösti Mälkki Reviewed-on: http://review.coreboot.org/3954 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Ronald G. Minnich Reviewed-by: Bruce Griffith --- src/mainboard/amd/olivehill/get_bus_conf.c | 6 ++---- src/mainboard/amd/olivehill/irq_tables.c | 2 +- src/mainboard/amd/olivehill/mptable.c | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) (limited to 'src/mainboard/amd/olivehill') diff --git a/src/mainboard/amd/olivehill/get_bus_conf.c b/src/mainboard/amd/olivehill/get_bus_conf.c index 0d379d5274..fb63ace4c5 100644 --- a/src/mainboard/amd/olivehill/get_bus_conf.c +++ b/src/mainboard/amd/olivehill/get_bus_conf.c @@ -30,7 +30,7 @@ * and acpi_tables busnum is default. */ u8 bus_isa; -u8 bus_yangtze[3]; +u8 bus_yangtze[6]; u32 apicid_yangtze; /* @@ -100,9 +100,7 @@ void get_bus_conf(void) sbdn_yangtze = 0; - for (i = 0; i < 3; i++) { - bus_yangtze[i] = 0; - } + memset(bus_yangtze, 0, sizeof(bus_yangtze)); for (i = 0; i < 256; i++) { bus_type[i] = 0; /* default ISA bus. */ diff --git a/src/mainboard/amd/olivehill/irq_tables.c b/src/mainboard/amd/olivehill/irq_tables.c index 977915348b..9eb36496fd 100644 --- a/src/mainboard/amd/olivehill/irq_tables.c +++ b/src/mainboard/amd/olivehill/irq_tables.c @@ -44,7 +44,7 @@ static void write_pirq_info(struct irq_info *pirq_info, u8 bus, u8 devfn, } extern u8 bus_isa; -extern u8 bus_yangtze[2]; +extern u8 bus_yangtze[6]; extern unsigned long sbdn_yangtze; unsigned long write_pirq_routing_table(unsigned long addr) diff --git a/src/mainboard/amd/olivehill/mptable.c b/src/mainboard/amd/olivehill/mptable.c index 118f86088d..83c0b41108 100644 --- a/src/mainboard/amd/olivehill/mptable.c +++ b/src/mainboard/amd/olivehill/mptable.c @@ -30,7 +30,7 @@ //-#define IO_APIC_ID CONFIG_MAX_PHYSICAL_CPUS + 1 #define IO_APIC_ID CONFIG_MAX_CPUS -extern u8 bus_yangtze[3]; +extern u8 bus_yangtze[6]; extern u32 bus_type[256]; extern u32 sbdn_yangtze; -- cgit v1.2.3