diff mbox series

[SRU,B,7/8] UBUNTU: SAUCE: Revert "modules: mark find_symbol static"

Message ID 20210617202225.1579294-8-ian.may@canonical.com
State New
Headers show
Series UBUNTU: SAUCE: Revert upstream 'module' patches that removed exported symbols | expand

Commit Message

Ian May June 17, 2021, 8:22 p.m. UTC
BugLink: https://bugs.launchpad.net/bugs/1932065

This reverts commit 80cdefadc339de305ae15d24a58cfb713e19420c.

Upstream introduced 'module' patches that removed exported symbols
that might cause potential disruption and breakage for customers.

Reverting as SAUCE patches to prevent regressions.

Signed-off-by: Ian May <ian.may@canonical.com>
---
 include/linux/module.h | 11 +++++++++++
 kernel/module.c        |  3 ++-
 2 files changed, 13 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/include/linux/module.h b/include/linux/module.h
index 44c7db9d7ac0..3e43cff43e17 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -530,6 +530,17 @@  struct symsearch {
 	bool unused;
 };
 
+/*
+ * Search for an exported symbol by name.
+ *
+ * Must be called with module_mutex held or preemption disabled.
+ */
+const struct kernel_symbol *find_symbol(const char *name,
+					struct module **owner,
+					const s32 **crc,
+					bool gplok,
+					bool warn);
+
 /*
  * Walk the exported symbol table
  *
diff --git a/kernel/module.c b/kernel/module.c
index b23045514742..4907d0b3ec71 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -570,7 +570,7 @@  static bool find_symbol_in_section(const struct symsearch *syms,
 
 /* Find a symbol and return it, along with, (optional) crc and
  * (optional) module which owns it.  Needs preempt disabled or module_mutex. */
-static const struct kernel_symbol *find_symbol(const char *name,
+const struct kernel_symbol *find_symbol(const char *name,
 					struct module **owner,
 					const s32 **crc,
 					bool gplok,
@@ -593,6 +593,7 @@  static const struct kernel_symbol *find_symbol(const char *name,
 	pr_debug("Failed to find symbol %s\n", name);
 	return NULL;
 }
+EXPORT_SYMBOL_GPL(find_symbol);
 
 /*
  * Search for module by name: must hold module_mutex (or preempt disabled