public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] module: fix BUG_ON() for powerpc (and other function descriptor archs)
@ 2009-08-26 12:32 Rusty Russell
  2009-08-26 12:34 ` [PATCH 2/2] module: workaround duplicate section names Rusty Russell
  0 siblings, 1 reply; 3+ messages in thread
From: Rusty Russell @ 2009-08-26 12:32 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel, Paul Mackerras

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.

diff --git a/kernel/module.c b/kernel/module.c
--- 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);
 }

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-08-27  4:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-26 12:32 [PATCH 1/2] module: fix BUG_ON() for powerpc (and other function descriptor archs) Rusty Russell
2009-08-26 12:34 ` [PATCH 2/2] module: workaround duplicate section names Rusty Russell
2009-08-27  4:53   ` Amerigo Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox