summaryrefslogtreecommitdiff
path: root/src/arch
diff options
context:
space:
mode:
authorNico Huber <nico.huber@secunet.com>2017-06-20 14:49:04 +0200
committerMartin Roth <martinroth@google.com>2017-06-22 15:20:17 +0000
commitaa9643e850f1af1f3762ad9fc892d2d1f09b3ca0 (patch)
tree7d82ce3c9fb3c4537bed6084cd6c554ed97bdda1 /src/arch
parent92a144cf1349c8a25aa8d2992f1e2a7c29560c9e (diff)
downloadcoreboot-aa9643e850f1af1f3762ad9fc892d2d1f09b3ca0.tar.xz
arch/x86/smbios: Fix scope of variable declaration
Fix up for 1b5eda0 (arch/x86/smbios: Fix undefined behavior) which introduced the variable `tmp` and used it out of scope. Should fix coverity CID 1376385 (Memory - illegal accesses (RETURN_LOCAL)). Change-Id: I8d4f664fc54faf6beb432b939dda4ddf93cf5d3e Found-by: Coverity Scan #1376385 Signed-off-by: Nico Huber <nico.huber@secunet.com> Reviewed-on: https://review.coreboot.org/20279 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Ryan Salsamendi <rsalsamendi@hotmail.com> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/x86/smbios.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/arch/x86/smbios.c b/src/arch/x86/smbios.c
index 2bbf3c9a20..97c58815f6 100644
--- a/src/arch/x86/smbios.c
+++ b/src/arch/x86/smbios.c
@@ -101,12 +101,12 @@ static int smbios_cpu_vendor(char *start)
static int smbios_processor_name(char *start)
{
+ u32 tmp[13];
const char *str = "Unknown Processor Name";
if (cpu_have_cpuid()) {
int i;
struct cpuid_result res = cpuid(0x80000000);
if (res.eax >= 0x80000004) {
- u32 tmp[13];
int j = 0;
for (i = 0; i < 3; i++) {
res = cpuid(0x80000002 + i);