diff options
Diffstat (limited to 'kernel')
| -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) | |||
| 909 | } | 909 | } |
| 910 | EXPORT_SYMBOL(__symbol_put); | 910 | EXPORT_SYMBOL(__symbol_put); |
| 911 | 911 | ||
| 912 | /* Note this assumes addr is a function, which it currently always is. */ | ||
| 912 | void symbol_put_addr(void *addr) | 913 | void symbol_put_addr(void *addr) |
| 913 | { | 914 | { |
| 914 | struct module *modaddr; | 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 | return; | 919 | return; |
| 918 | 920 | ||
| 919 | /* module_text_address is safe here: we're supposed to have reference | 921 | /* module_text_address is safe here: we're supposed to have reference |
| 920 | * to module from symbol_get, so it can't go away. */ | 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 | BUG_ON(!modaddr); | 924 | BUG_ON(!modaddr); |
| 923 | module_put(modaddr); | 925 | module_put(modaddr); |
| 924 | } | 926 | } |
