Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Rusty Russell and committed by
Linus Torvalds
7d1d16e4 0a80fb10

+4 -2
+4 -2
kernel/module.c
··· 909 909 } 910 910 EXPORT_SYMBOL(__symbol_put); 911 911 912 + /* Note this assumes addr is a function, which it currently always is. */ 912 913 void symbol_put_addr(void *addr) 913 914 { 914 915 struct module *modaddr; 916 + unsigned long a = (unsigned long)dereference_function_descriptor(addr); 915 917 916 - if (core_kernel_text((unsigned long)addr)) 918 + if (core_kernel_text(a)) 917 919 return; 918 920 919 921 /* module_text_address is safe here: we're supposed to have reference 920 922 * to module from symbol_get, so it can't go away. */ 921 - modaddr = __module_text_address((unsigned long)addr); 923 + modaddr = __module_text_address(a); 922 924 BUG_ON(!modaddr); 923 925 module_put(modaddr); 924 926 }