Merge tag 'modules-6.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof...
[linux-block.git] / kernel / module / kallsyms.c
index d8e426a9a0cd4846a2fd5e8d559e1d914c8f2d18..c550d7d45f2fb560720ab398bbae79c536bc56ed 100644 (file)
@@ -439,7 +439,7 @@ int module_get_kallsym(unsigned int symnum, unsigned long *value, char *type,
 }
 
 /* Given a module and name of symbol, find and return the symbol's value */
-unsigned long find_kallsyms_symbol_value(struct module *mod, const char *name)
+static unsigned long __find_kallsyms_symbol_value(struct module *mod, const char *name)
 {
        unsigned int i;
        struct mod_kallsyms *kallsyms = rcu_dereference_sched(mod->kallsyms);
@@ -463,7 +463,7 @@ static unsigned long __module_kallsyms_lookup_name(const char *name)
        if (colon) {
                mod = find_module_all(name, colon - name, false);
                if (mod)
-                       return find_kallsyms_symbol_value(mod, colon + 1);
+                       return __find_kallsyms_symbol_value(mod, colon + 1);
                return 0;
        }
 
@@ -472,7 +472,7 @@ static unsigned long __module_kallsyms_lookup_name(const char *name)
 
                if (mod->state == MODULE_STATE_UNFORMED)
                        continue;
-               ret = find_kallsyms_symbol_value(mod, name);
+               ret = __find_kallsyms_symbol_value(mod, name);
                if (ret)
                        return ret;
        }
@@ -491,6 +491,16 @@ unsigned long module_kallsyms_lookup_name(const char *name)
        return ret;
 }
 
+unsigned long find_kallsyms_symbol_value(struct module *mod, const char *name)
+{
+       unsigned long ret;
+
+       preempt_disable();
+       ret = __find_kallsyms_symbol_value(mod, name);
+       preempt_enable();
+       return ret;
+}
+
 int module_kallsyms_on_each_symbol(const char *modname,
                                   int (*fn)(void *, const char *, unsigned long),
                                   void *data)