Skip to content

Commit 98a4462

Browse files
bp3tk0vgregkh
authored andcommitted
x86/microcode/AMD: Fix a -Wsometimes-uninitialized clang false positive
commit 5343558 upstream. Initialize equiv_id in order to shut up: arch/x86/kernel/cpu/microcode/amd.c:714:6: warning: variable 'equiv_id' is \ used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] if (x86_family(bsp_cpuid_1_eax) < 0x17) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ because clang doesn't do interprocedural analysis for warnings to see that this variable won't be used uninitialized. Fixes: 94838d2 ("x86/microcode/AMD: Use the family,model,stepping encoded in the patch ID") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202407291815.gJBST0P3-lkp@intel.com/ Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent a4921b7 commit 98a4462

File tree

1 file changed

+1
-1
lines changed
  • arch/x86/kernel/cpu/microcode

1 file changed

+1
-1
lines changed

arch/x86/kernel/cpu/microcode/amd.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,7 @@ static void free_cache(void)
813813
static struct ucode_patch *find_patch(unsigned int cpu)
814814
{
815815
struct ucode_cpu_info *uci = ucode_cpu_info + cpu;
816-
u16 equiv_id;
816+
u16 equiv_id = 0;
817817

818818
uci->cpu_sig.rev = get_patch_level();
819819

0 commit comments

Comments
 (0)