summaryrefslogtreecommitdiff
path: root/kernel/static_call.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/static_call.c')
-rw-r--r--kernel/static_call.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/kernel/static_call.c b/kernel/static_call.c
index fc2259047be2..2c5950b0b90e 100644
--- a/kernel/static_call.c
+++ b/kernel/static_call.c
@@ -181,7 +181,16 @@ void __static_call_update(struct static_call_key *key, void *tramp, void *func)
continue;
if (!kernel_text_address((unsigned long)site_addr)) {
- WARN_ONCE(1, "can't patch static call site at %pS",
+ /*
+ * This skips patching built-in __exit, which
+ * is part of init_section_contains() but is
+ * not part of kernel_text_address().
+ *
+ * Skipping built-in __exit is fine since it
+ * will never be executed.
+ */
+ WARN_ONCE(!static_call_is_init(site),
+ "can't patch static call site at %pS",
site_addr);
continue;
}