diff options
author | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2013-09-09 09:23:19 +0300 |
---|---|---|
committer | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2013-09-11 07:05:25 +0200 |
commit | 9c7d73ca3f5b2985cb0f498038a746bcc0f2cac7 (patch) | |
tree | 3cac03ff8b7c0e224d5963ac77239538e04ebee9 /src/mainboard/lippert | |
parent | c984f4f30333cde88fbd14a188c5ce599d0fc77c (diff) | |
download | coreboot-9c7d73ca3f5b2985cb0f498038a746bcc0f2cac7.tar.xz |
AMD sb800 sb900: Fix corruption of a global ramstage variable
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 <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/3914
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@google.com>
Reviewed-by: Bruce Griffith <Bruce.Griffith@se-eng.com>
Diffstat (limited to 'src/mainboard/lippert')
-rw-r--r-- | src/mainboard/lippert/frontrunner-af/get_bus_conf.c | 6 | ||||
-rw-r--r-- | src/mainboard/lippert/frontrunner-af/irq_tables.c | 2 | ||||
-rw-r--r-- | src/mainboard/lippert/frontrunner-af/mptable.c | 2 | ||||
-rw-r--r-- | src/mainboard/lippert/toucan-af/get_bus_conf.c | 6 | ||||
-rw-r--r-- | src/mainboard/lippert/toucan-af/irq_tables.c | 2 | ||||
-rw-r--r-- | src/mainboard/lippert/toucan-af/mptable.c | 2 |
6 files changed, 8 insertions, 12 deletions
diff --git a/src/mainboard/lippert/frontrunner-af/get_bus_conf.c b/src/mainboard/lippert/frontrunner-af/get_bus_conf.c index 8872bb5a1c..258d895736 100644 --- a/src/mainboard/lippert/frontrunner-af/get_bus_conf.c +++ b/src/mainboard/lippert/frontrunner-af/get_bus_conf.c @@ -34,7 +34,7 @@ * and acpi_tables busnum is default. */ u8 bus_isa; -u8 bus_sb800[3]; +u8 bus_sb800[6]; u32 apicid_sb800; /* @@ -99,9 +99,7 @@ void get_bus_conf(void) #endif sbdn_sb800 = 0; - for (i = 0; i < 3; i++) { - bus_sb800[i] = 0; - } + memset(bus_sb800, 0, sizeof(bus_sb800)); for (i = 0; i < 256; i++) { bus_type[i] = 0; /* default ISA bus. */ diff --git a/src/mainboard/lippert/frontrunner-af/irq_tables.c b/src/mainboard/lippert/frontrunner-af/irq_tables.c index 5323d446ef..b9577cfbaa 100644 --- a/src/mainboard/lippert/frontrunner-af/irq_tables.c +++ b/src/mainboard/lippert/frontrunner-af/irq_tables.c @@ -45,7 +45,7 @@ static void write_pirq_info(struct irq_info *pirq_info, u8 bus, u8 devfn, pirq_info->rfu = rfu; } extern u8 bus_isa; -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/lippert/frontrunner-af/mptable.c b/src/mainboard/lippert/frontrunner-af/mptable.c index fd0305887c..6b8aaa6593 100644 --- a/src/mainboard/lippert/frontrunner-af/mptable.c +++ b/src/mainboard/lippert/frontrunner-af/mptable.c @@ -27,7 +27,7 @@ #include <cpu/amd/amdfam14.h> #include <SBPLATFORM.h> -extern u8 bus_sb800[2]; +extern u8 bus_sb800[6]; extern u32 apicid_sb800; diff --git a/src/mainboard/lippert/toucan-af/get_bus_conf.c b/src/mainboard/lippert/toucan-af/get_bus_conf.c index 8872bb5a1c..258d895736 100644 --- a/src/mainboard/lippert/toucan-af/get_bus_conf.c +++ b/src/mainboard/lippert/toucan-af/get_bus_conf.c @@ -34,7 +34,7 @@ * and acpi_tables busnum is default. */ u8 bus_isa; -u8 bus_sb800[3]; +u8 bus_sb800[6]; u32 apicid_sb800; /* @@ -99,9 +99,7 @@ void get_bus_conf(void) #endif sbdn_sb800 = 0; - for (i = 0; i < 3; i++) { - bus_sb800[i] = 0; - } + memset(bus_sb800, 0, sizeof(bus_sb800)); for (i = 0; i < 256; i++) { bus_type[i] = 0; /* default ISA bus. */ diff --git a/src/mainboard/lippert/toucan-af/irq_tables.c b/src/mainboard/lippert/toucan-af/irq_tables.c index 5323d446ef..b9577cfbaa 100644 --- a/src/mainboard/lippert/toucan-af/irq_tables.c +++ b/src/mainboard/lippert/toucan-af/irq_tables.c @@ -45,7 +45,7 @@ static void write_pirq_info(struct irq_info *pirq_info, u8 bus, u8 devfn, pirq_info->rfu = rfu; } extern u8 bus_isa; -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/lippert/toucan-af/mptable.c b/src/mainboard/lippert/toucan-af/mptable.c index fd0305887c..6b8aaa6593 100644 --- a/src/mainboard/lippert/toucan-af/mptable.c +++ b/src/mainboard/lippert/toucan-af/mptable.c @@ -27,7 +27,7 @@ #include <cpu/amd/amdfam14.h> #include <SBPLATFORM.h> -extern u8 bus_sb800[2]; +extern u8 bus_sb800[6]; extern u32 apicid_sb800; |