diff options
-rw-r--r-- | lib/codetag.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/codetag.c b/lib/codetag.c index a936d2988c96..0c78906266f4 100644 --- a/lib/codetag.c +++ b/lib/codetag.c @@ -244,15 +244,20 @@ static inline size_t range_size(const struct codetag_type *cttype, static void *get_symbol(struct module *mod, const char *prefix, const char *name) { char buf[64]; + void *ret; int res; res = snprintf(buf, sizeof(buf), "%s%s", prefix, name); if (WARN_ON(res < 1 || res > sizeof(buf))) return NULL; - return mod ? + preempt_disable(); + ret = mod ? (void *)find_kallsyms_symbol_value(mod, buf) : (void *)kallsyms_lookup_name(buf); + preempt_enable(); + + return ret; } static struct codetag_range get_section_range(struct module *mod, |