diff options
author | H. Peter Anvin <hpa@linux.intel.com> | 2010-07-13 17:57:50 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2010-07-13 17:57:50 -0400 |
commit | 3b770a2128423a687e6e9c57184a584fb4ba4c77 (patch) | |
tree | e9e4698fa84db10d6a58a78103ecc16fe4e5a94b | |
parent | df378ccfc4dd04e263426ad805516915874774aa (diff) |
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: H. Peter Anvin <hpa@linux.intel.com>
Cc: Yinghai Lu <yinhai@kernel.org>
Cc: Suresh Siddha <suresh.b.siddha@intel.com>
LKML-Reference: <tip-df378ccfc4dd04e263426ad805516915874774aa@git.kernel.org>
-rw-r--r-- | arch/x86/kernel/alternative.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index 70237732a6c7..f65ab8b014c4 100644 --- a/arch/x86/kernel/alternative.c +++ b/arch/x86/kernel/alternative.c | |||
@@ -214,6 +214,7 @@ void __init_or_module apply_alternatives(struct alt_instr *start, | |||
214 | u8 *instr = a->instr; | 214 | u8 *instr = a->instr; |
215 | BUG_ON(a->replacementlen > a->instrlen); | 215 | BUG_ON(a->replacementlen > a->instrlen); |
216 | BUG_ON(a->instrlen > sizeof(insnbuf)); | 216 | BUG_ON(a->instrlen > sizeof(insnbuf)); |
217 | BUG_ON(a->cpuid >= NCAPINTS*32); | ||
217 | if (!boot_cpu_has(a->cpuid)) | 218 | if (!boot_cpu_has(a->cpuid)) |
218 | continue; | 219 | continue; |
219 | #ifdef CONFIG_X86_64 | 220 | #ifdef CONFIG_X86_64 |