diff options
Diffstat (limited to 'kernel/module.c')
-rw-r--r-- | kernel/module.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/kernel/module.c b/kernel/module.c index b86b7bf1be38..8f051a106676 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
@@ -1063,11 +1063,15 @@ void symbol_put_addr(void *addr) | |||
1063 | if (core_kernel_text(a)) | 1063 | if (core_kernel_text(a)) |
1064 | return; | 1064 | return; |
1065 | 1065 | ||
1066 | /* module_text_address is safe here: we're supposed to have reference | 1066 | /* |
1067 | * to module from symbol_get, so it can't go away. */ | 1067 | * Even though we hold a reference on the module; we still need to |
1068 | * disable preemption in order to safely traverse the data structure. | ||
1069 | */ | ||
1070 | preempt_disable(); | ||
1068 | modaddr = __module_text_address(a); | 1071 | modaddr = __module_text_address(a); |
1069 | BUG_ON(!modaddr); | 1072 | BUG_ON(!modaddr); |
1070 | module_put(modaddr); | 1073 | module_put(modaddr); |
1074 | preempt_enable(); | ||
1071 | } | 1075 | } |
1072 | EXPORT_SYMBOL_GPL(symbol_put_addr); | 1076 | EXPORT_SYMBOL_GPL(symbol_put_addr); |
1073 | 1077 | ||