diff options
-rw-r--r-- | kernel/module.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/kernel/module.c b/kernel/module.c index dd2a54155b54..895c5675edb7 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
@@ -1725,15 +1725,15 @@ static const struct kernel_symbol *lookup_symbol(const char *name, | |||
1725 | return NULL; | 1725 | return NULL; |
1726 | } | 1726 | } |
1727 | 1727 | ||
1728 | static int is_exported(const char *name, const struct module *mod) | 1728 | static int is_exported(const char *name, unsigned long value, |
1729 | const struct module *mod) | ||
1729 | { | 1730 | { |
1730 | if (!mod && lookup_symbol(name, __start___ksymtab, __stop___ksymtab)) | 1731 | const struct kernel_symbol *ks; |
1731 | return 1; | 1732 | if (!mod) |
1733 | ks = lookup_symbol(name, __start___ksymtab, __stop___ksymtab); | ||
1732 | else | 1734 | else |
1733 | if (mod && lookup_symbol(name, mod->syms, mod->syms + mod->num_syms)) | 1735 | ks = lookup_symbol(name, mod->syms, mod->syms + mod->num_syms); |
1734 | return 1; | 1736 | return ks != NULL && ks->value == value; |
1735 | else | ||
1736 | return 0; | ||
1737 | } | 1737 | } |
1738 | 1738 | ||
1739 | /* As per nm */ | 1739 | /* As per nm */ |
@@ -2504,7 +2504,7 @@ int module_get_kallsym(unsigned int symnum, unsigned long *value, char *type, | |||
2504 | strlcpy(name, mod->strtab + mod->symtab[symnum].st_name, | 2504 | strlcpy(name, mod->strtab + mod->symtab[symnum].st_name, |
2505 | KSYM_NAME_LEN); | 2505 | KSYM_NAME_LEN); |
2506 | strlcpy(module_name, mod->name, MODULE_NAME_LEN); | 2506 | strlcpy(module_name, mod->name, MODULE_NAME_LEN); |
2507 | *exported = is_exported(name, mod); | 2507 | *exported = is_exported(name, *value, mod); |
2508 | preempt_enable(); | 2508 | preempt_enable(); |
2509 | return 0; | 2509 | return 0; |
2510 | } | 2510 | } |