File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2720,14 +2720,14 @@ int nand_scan_tail(struct mtd_info *mtd)
27202720 return chip -> scan_bbt (mtd );
27212721}
27222722
2723- /* module_text_address () isn't exported, and it's mostly a pointless
2723+ /* is_module_text_address () isn't exported, and it's mostly a pointless
27242724 test if this is a module _anyway_ -- they'd have to try _really_ hard
27252725 to call us from in-kernel code if the core NAND support is modular. */
27262726#ifdef MODULE
27272727#define caller_is_module () (1)
27282728#else
27292729#define caller_is_module () \
2730- module_text_address ((unsigned long)__builtin_return_address(0))
2730+ is_module_text_address ((unsigned long)__builtin_return_address(0))
27312731#endif
27322732
27332733/**
Original file line number Diff line number Diff line change @@ -362,8 +362,6 @@ static inline int module_is_live(struct module *mod)
362362 return mod -> state != MODULE_STATE_GOING ;
363363}
364364
365- /* Is this address in a module? (second is with no locks, for oops) */
366- struct module * module_text_address (unsigned long addr );
367365struct module * __module_text_address (unsigned long addr );
368366struct module * __module_address (unsigned long addr );
369367bool is_module_address (unsigned long addr );
@@ -496,11 +494,6 @@ search_module_extables(unsigned long addr)
496494 return NULL ;
497495}
498496
499- static inline struct module * module_text_address (unsigned long addr )
500- {
501- return NULL ;
502- }
503-
504497static inline struct module * __module_address (unsigned long addr )
505498{
506499 return NULL ;
Original file line number Diff line number Diff line change @@ -58,14 +58,14 @@ __notrace_funcgraph int __kernel_text_address(unsigned long addr)
5858{
5959 if (core_kernel_text (addr ))
6060 return 1 ;
61- return __module_text_address (addr ) != NULL ;
61+ return is_module_text_address (addr );
6262}
6363
6464int kernel_text_address (unsigned long addr )
6565{
6666 if (core_kernel_text (addr ))
6767 return 1 ;
68- return module_text_address (addr ) != NULL ;
68+ return is_module_text_address (addr );
6969}
7070
7171/*
@@ -81,5 +81,5 @@ int func_ptr_is_kernel_text(void *ptr)
8181 addr = (unsigned long ) dereference_function_descriptor (ptr );
8282 if (core_kernel_text (addr ))
8383 return 1 ;
84- return module_text_address (addr ) != NULL ;
84+ return is_module_text_address (addr );
8585}
Original file line number Diff line number Diff line change @@ -908,8 +908,10 @@ void symbol_put_addr(void *addr)
908908 if (core_kernel_text ((unsigned long )addr ))
909909 return ;
910910
911- if (!(modaddr = module_text_address ((unsigned long )addr )))
912- BUG ();
911+ /* module_text_address is safe here: we're supposed to have reference
912+ * to module from symbol_get, so it can't go away. */
913+ modaddr = __module_text_address ((unsigned long )addr );
914+ BUG_ON (!modaddr );
913915 module_put (modaddr );
914916}
915917EXPORT_SYMBOL_GPL (symbol_put_addr );
@@ -2821,17 +2823,6 @@ struct module *__module_text_address(unsigned long addr)
28212823 return mod ;
28222824}
28232825
2824- struct module * module_text_address (unsigned long addr )
2825- {
2826- struct module * mod ;
2827-
2828- preempt_disable ();
2829- mod = __module_text_address (addr );
2830- preempt_enable ();
2831-
2832- return mod ;
2833- }
2834-
28352826/* Don't grab lock, we're oopsing. */
28362827void print_modules (void )
28372828{
You can’t perform that action at this time.
0 commit comments