Loading
x86/microcode/AMD: Fix a -Wsometimes-uninitialized clang false positive
stable inclusion from stable-v6.6.81 commit 98a44622be2f193dc31bc542948407cac2bed9dc category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IBYZED Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=98a44622be2f193dc31bc542948407cac2bed9dc -------------------------------- commit 5343558a868e7e635b40baa2e46bf53df1a2d131 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: 94838d230a6c ("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> (cherry picked from commit 98a44622be2f193dc31bc542948407cac2bed9dc) Signed-off-by:
Wentao Guan <guanwentao@uniontech.com>