From aa9643e850f1af1f3762ad9fc892d2d1f09b3ca0 Mon Sep 17 00:00:00 2001 From: Nico Huber Date: Tue, 20 Jun 2017 14:49:04 +0200 Subject: arch/x86/smbios: Fix scope of variable declaration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-on: https://review.coreboot.org/20279 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin Reviewed-by: Ryan Salsamendi Reviewed-by: Paul Menzel Reviewed-by: Philippe Mathieu-Daudé --- src/arch/x86/smbios.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/arch/x86/smbios.c') 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); -- cgit v1.2.3