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>
This commit is contained in:
Nico Huber 2017-06-20 14:49:04 +02:00 committed by Martin Roth
parent 92a144cf13
commit aa9643e850
1 changed files with 1 additions and 1 deletions

View File

@ -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);