Skip to contentSkip to conversation

x86, microcode: remove an unneeded NULL check

PATCH Borislav Petkov 1 participant 1 message Jan 22, 2016 Kernel janitors

lore
Share & tools
lore

Borislav Petkov

author Applied
#0 lore raw
Quoted 9 lines · Dan Carpenter

"uci" is an element of the ucode_cpu_info[] array, it can't be NULL.

arch/x86/kernel/cpu/microcode/core.c +0 -0
index 15c987698b0f..05db44e4198c 100644

arch/x86/kernel/cpu/microcode/core.c static enum ucode_state microcode_init_cpu(int cpu, bool refresh_fw) · line 388

Quoted 8 lines
arch/x86/kernel/cpu/microcode/core.c +1 -1
@@ -382,7 +382,7 @@ static enum ucode_state microcode_init_cpu(int cpu, bool refresh_fw)
 	enum ucode_state ustate;
 	struct ucode_cpu_info *uci = ucode_cpu_info + cpu;
 
-	if (uci && uci->valid)
+	if (uci->valid)
 		return UCODE_OK;
 
 	if (collect_cpu_info(cpu))

Applied, after almost 2 years!

Thanks.

Signature · 5 lines
Regards/Gruss,
    Boris.

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
--