summaryrefslogtreecommitdiff
path: root/kernel/module.c
diff options
context:
space:
mode:
authorChris Zankel <chris@zankel.net>2015-08-29 23:55:58 (GMT)
committerChris Zankel <chris@zankel.net>2015-08-29 23:55:58 (GMT)
commit650c919798c71fb34b77a6f2ba03a06907f06a76 (patch)
treed1c60012d4d86846d25f1d0b783b5122c26a2e31 /kernel/module.c
parent895fb3159280fe7695b35ec7c87ec19e13ca5b6e (diff)
parent64291f7db5bd8150a74ad2036f1037e6a0428df2 (diff)
downloadlinux-650c919798c71fb34b77a6f2ba03a06907f06a76.tar.xz
Merge tag 'v4.2' into for_next
Linux 4.2
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 4d2b82e..b86b7bf 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -602,13 +602,16 @@ const struct kernel_symbol *find_symbol(const char *name,
}
EXPORT_SYMBOL_GPL(find_symbol);
-/* Search for module by name: must hold module_mutex. */
+/*
+ * Search for module by name: must hold module_mutex (or preempt disabled
+ * for read-only access).
+ */
static struct module *find_module_all(const char *name, size_t len,
bool even_unformed)
{
struct module *mod;
- module_assert_mutex();
+ module_assert_mutex_or_preempt();
list_for_each_entry(mod, &modules, list) {
if (!even_unformed && mod->state == MODULE_STATE_UNFORMED)
@@ -621,6 +624,7 @@ static struct module *find_module_all(const char *name, size_t len,
struct module *find_module(const char *name)
{
+ module_assert_mutex();
return find_module_all(name, strlen(name), false);
}
EXPORT_SYMBOL_GPL(find_module);