hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I95JOC
--------------------------------
This reverts commit c51cbcde677fe759f4566849a16888ecf4d3ae8b. --- kernel/module.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-)
diff --git a/kernel/module.c b/kernel/module.c index b41757ffb307..e978debc93df 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -2289,26 +2289,15 @@ static void free_module(struct module *mod) void *__symbol_get(const char *symbol) { struct module *owner; - enum mod_license license; const struct kernel_symbol *sym;
preempt_disable(); - sym = find_symbol(symbol, &owner, NULL, &license, true, true); - if (!sym) - goto fail; - if (license != GPL_ONLY) { - pr_warn("failing symbol_get of non-GPLONLY symbol %s.\n", - symbol); - goto fail; - } - if (strong_try_module_get(owner)) + sym = find_symbol(symbol, &owner, NULL, NULL, true, true); + if (sym && strong_try_module_get(owner)) sym = NULL; preempt_enable();
return sym ? (void *)kernel_symbol_value(sym) : NULL; -fail: - preempt_enable(); - return NULL; } EXPORT_SYMBOL_GPL(__symbol_get);