diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2009-03-31 13:05:31 -0600 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2009-03-31 13:05:32 +1030 |
commit | a6e6abd575fcbe6572ebc7a70ad616406d206fa8 (patch) | |
tree | 3909d2be063116936179bb4da85d5cb4aed32ce6 /kernel/module.c | |
parent | e610499e2656e61975affd0af56b26eb73964c84 (diff) | |
download | linux-a6e6abd575fcbe6572ebc7a70ad616406d206fa8.tar.bz2 |
module: remove module_text_address()
Impact: Replace and remove risky (non-EXPORTed) API
module_text_address() returns a pointer to the module, which given locking
improvements in module.c, is useless except to test for NULL:
1) If the module can't go away, use __module_text_address.
2) Otherwise, just use is_module_text_address().
Cc: linux-mtd@lists.infradead.org
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'kernel/module.c')
-rw-r--r-- | kernel/module.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/kernel/module.c b/kernel/module.c index bd15a94f91c1..8ddca629e079 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -908,8 +908,10 @@ void symbol_put_addr(void *addr) if (core_kernel_text((unsigned long)addr)) return; - if (!(modaddr = module_text_address((unsigned long)addr))) - BUG(); + /* module_text_address is safe here: we're supposed to have reference + * to module from symbol_get, so it can't go away. */ + modaddr = __module_text_address((unsigned long)addr); + BUG_ON(!modaddr); module_put(modaddr); } EXPORT_SYMBOL_GPL(symbol_put_addr); @@ -2821,17 +2823,6 @@ struct module *__module_text_address(unsigned long addr) return mod; } -struct module *module_text_address(unsigned long addr) -{ - struct module *mod; - - preempt_disable(); - mod = __module_text_address(addr); - preempt_enable(); - - return mod; -} - /* Don't grab lock, we're oopsing. */ void print_modules(void) { |