diff options
Diffstat (limited to 'include/asm-generic/sections.h')
-rw-r--r-- | include/asm-generic/sections.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/include/asm-generic/sections.h b/include/asm-generic/sections.h index 1dfadb2e878d..00566b1fd699 100644 --- a/include/asm-generic/sections.h +++ b/include/asm-generic/sections.h @@ -193,12 +193,16 @@ static inline bool __is_kernel_text(unsigned long addr) * @addr: address to check * * Returns: true if the address is located in the kernel range, false otherwise. - * Note: an internal helper, only check the range of _stext to _end. + * Note: an internal helper, check the range of _stext to _end, + * and range from __init_begin to __init_end, which can be outside + * of the _stext to _end range. */ static inline bool __is_kernel(unsigned long addr) { - return addr >= (unsigned long)_stext && - addr < (unsigned long)_end; + return ((addr >= (unsigned long)_stext && + addr < (unsigned long)_end) || + (addr >= (unsigned long)__init_begin && + addr < (unsigned long)__init_end)); } #endif /* _ASM_GENERIC_SECTIONS_H_ */ |