diff options
-rw-r--r-- | arch/x86/kernel/alternative.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index 3c13284ff86d..e63b80e5861c 100644 --- a/arch/x86/kernel/alternative.c +++ b/arch/x86/kernel/alternative.c | |||
@@ -395,12 +395,14 @@ int alternatives_text_reserved(void *start, void *end) | |||
395 | { | 395 | { |
396 | struct smp_alt_module *mod; | 396 | struct smp_alt_module *mod; |
397 | u8 **ptr; | 397 | u8 **ptr; |
398 | u8 *text_start = start; | ||
399 | u8 *text_end = end; | ||
398 | 400 | ||
399 | list_for_each_entry(mod, &smp_alt_modules, next) { | 401 | list_for_each_entry(mod, &smp_alt_modules, next) { |
400 | if (mod->text > end || mod->text_end < start) | 402 | if (mod->text > text_end || mod->text_end < text_start) |
401 | continue; | 403 | continue; |
402 | for (ptr = mod->locks; ptr < mod->locks_end; ptr++) | 404 | for (ptr = mod->locks; ptr < mod->locks_end; ptr++) |
403 | if (start <= *ptr && end >= *ptr) | 405 | if (text_start <= *ptr && text_end >= *ptr) |
404 | return 1; | 406 | return 1; |
405 | } | 407 | } |
406 | 408 | ||