diff options
author | Rusty Russell | 2009-08-26 14:32:54 +0200 |
---|---|---|
committer | Linus Torvalds | 2009-08-27 21:33:19 +0200 |
commit | 7d1d16e416e61aeef8655d542f8e4a4fc6e808e4 (patch) | |
tree | dfa53b29720cffdba1a64876de30567b6ed5e766 | |
parent | xenfb: connect to backend before registering fb (diff) | |
download | kernel-qcow2-linux-7d1d16e416e61aeef8655d542f8e4a4fc6e808e4.tar.gz kernel-qcow2-linux-7d1d16e416e61aeef8655d542f8e4a4fc6e808e4.tar.xz kernel-qcow2-linux-7d1d16e416e61aeef8655d542f8e4a4fc6e808e4.zip |
module: fix BUG_ON() for powerpc (and other function descriptor archs)
The rarely-used symbol_put_addr() needs to use dereference_function_descriptor
on powerpc.
Reported-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | kernel/module.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/module.c b/kernel/module.c index fd1411403558..07c80e68a6c4 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -909,16 +909,18 @@ void __symbol_put(const char *symbol) } EXPORT_SYMBOL(__symbol_put); +/* Note this assumes addr is a function, which it currently always is. */ void symbol_put_addr(void *addr) { struct module *modaddr; + unsigned long a = (unsigned long)dereference_function_descriptor(addr); - if (core_kernel_text((unsigned long)addr)) + if (core_kernel_text(a)) return; /* 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); + modaddr = __module_text_address(a); BUG_ON(!modaddr); module_put(modaddr); } |