summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-03-13 15:40:05 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-03-14 20:27:43 -0400
commit91b9486edb7bdbe7ea0abd9198b280b15ff4fedb (patch)
treee3c96c5f637810fb24f2600e318781ae983d1bda
parent3504cbdfb90499459fbee29ac426c3cb0650f092 (diff)
fixup! lib: code tagging module support
-rw-r--r--lib/codetag.c7
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,