Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3b770a21 authored by H. Peter Anvin's avatar H. Peter Anvin
Browse files

x86, alternatives: BUG on encountering an invalid CPU feature number



Make the alternatives-patching code BUG on encountering an invalid CPU
feature number.  Should have done this a long time ago.

Signed-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
Cc: Yinghai Lu <yinhai@kernel.org>
Cc: Suresh Siddha <suresh.b.siddha@intel.com>
LKML-Reference: <tip-df378ccf@git.kernel.org>
parent df378ccf
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -214,6 +214,7 @@ void __init_or_module apply_alternatives(struct alt_instr *start,
		u8 *instr = a->instr;
		BUG_ON(a->replacementlen > a->instrlen);
		BUG_ON(a->instrlen > sizeof(insnbuf));
		BUG_ON(a->cpuid >= NCAPINTS*32);
		if (!boot_cpu_has(a->cpuid))
			continue;
#ifdef CONFIG_X86_64