aboutsummaryrefslogtreecommitdiff
path: root/kernel/module.c
diff options
context:
space:
mode:
authorKevin Hilman <khilman@linaro.org>2015-12-17 08:47:57 -0800
committerKevin Hilman <khilman@linaro.org>2015-12-17 08:47:57 -0800
commit8b20b3796da06d8ada347c4eaf289c3127da155f (patch)
treecf5c1e1d8c177307df660f503743f8d5bfcd39a5 /kernel/module.c
parent49bd04cb11e57c4cd4d2c00feca898537dd6db1f (diff)
parent419f2e2c67426866f3bdaab80caa6faa3a082ad6 (diff)
downloadlinux-linaro-stable-8b20b3796da06d8ada347c4eaf289c3127da155f.tar.gz
Merge tag 'v4.1.13-rt15' of git://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel into v4.1/topic/rt
v4.1.13-rt15
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 cfc9e843a924..3b9ff966edb9 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -906,11 +906,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);