aboutsummaryrefslogtreecommitdiff
path: root/kernel/module.c
diff options
context:
space:
mode:
authorAlex Shi <alex.shi@linaro.org>2016-01-14 22:25:14 +0800
committerAlex Shi <alex.shi@linaro.org>2016-01-14 22:25:14 +0800
commitf90ae1b62bedd8b57966a7be68855f2d43170db6 (patch)
treedc332d18219749a17b163d740b8713be5e8d940b /kernel/module.c
parent346a8beb760237fb0fed811045ec92c799f48d54 (diff)
parent60917545df1ffc7f918550512dc4a14758f74784 (diff)
Merge remote-tracking branch 'lts/linux-3.18.y' into linux-linaro-lsk-v3.18lsk-v3.18-16.01
Diffstat (limited to 'kernel/module.c')
-rw-r--r--kernel/module.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/kernel/module.c b/kernel/module.c
index c353707bbbd5..3da0c001d985 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -914,11 +914,15 @@ void symbol_put_addr(void *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. */
+ /*
+ * Even though we hold a reference on the module; we still need to
+ * disable preemption in order to safely traverse the data structure.
+ */
+ preempt_disable();
modaddr = __module_text_address(a);
BUG_ON(!modaddr);
module_put(modaddr);
+ preempt_enable();
}
EXPORT_SYMBOL_GPL(symbol_put_addr);