aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/rust/macros
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2024-03-25 21:11:58 +0100
committerThomas Zimmermann <tzimmermann@suse.de>2024-03-25 21:11:58 +0100
commit36a1818f5a1e50b805317ba13f827067d50f6970 (patch)
treeb9414b9509bea9f006c292a46a7632ffb57d18ee /rust/macros
parentdma-buf: Fix NULL pointer dereference in sanitycheck() (diff)
parentLinux 6.9-rc1 (diff)
downloadwireguard-linux-36a1818f5a1e50b805317ba13f827067d50f6970.tar.xz
wireguard-linux-36a1818f5a1e50b805317ba13f827067d50f6970.zip
Merge drm/drm-fixes into drm-misc-fixes
Backmerging to get drm-misc-fixes to the state of v6.9-rc1. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Diffstat (limited to 'rust/macros')
-rw-r--r--rust/macros/module.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/rust/macros/module.rs b/rust/macros/module.rs
index d62d8710d77a..27979e582e4b 100644
--- a/rust/macros/module.rs
+++ b/rust/macros/module.rs
@@ -222,10 +222,15 @@ pub(crate) fn module(ts: TokenStream) -> TokenStream {
}};
// Loadable modules need to export the `{{init,cleanup}}_module` identifiers.
+ /// # Safety
+ ///
+ /// This function must not be called after module initialization, because it may be
+ /// freed after that completes.
#[cfg(MODULE)]
#[doc(hidden)]
#[no_mangle]
- pub extern \"C\" fn init_module() -> core::ffi::c_int {{
+ #[link_section = \".init.text\"]
+ pub unsafe extern \"C\" fn init_module() -> core::ffi::c_int {{
__init()
}}