Skip to content

Commit

Permalink
s: main; unmark __exit
Browse files Browse the repository at this point in the history
WARNING: modpost:
/home/nabijaczleweli/uwu/unicode-oot/module/zfs.o(.init.text+0x342):
Section mismatch in reference from the function init_module() to the
function .exit.text:zcommon_fini()
The function __init init_module() references
a function __exit zcommon_fini().
This is often seen when error handling in the init function
uses functionality in the exit path.
The fix is often to remove the __exit annotation of
zcommon_fini() so it may be used outside an exit section.
  • Loading branch information
nabijaczleweli committed Apr 6, 2022
1 parent 04f4be9 commit f5456a2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion module/icp/illumos-crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
* ZFS Makefiles.
*/

void __exit
void
icp_fini(void)
{
skein_mod_fini();
Expand Down
2 changes: 1 addition & 1 deletion module/os/linux/zfs/zfs_ioctl_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ openzfs_fini_os(void)


extern int __init zcommon_init(void);
extern void __exit zcommon_fini(void);
extern void zcommon_fini(void);

static int __init
openzfs_init(void)
Expand Down
4 changes: 2 additions & 2 deletions module/zcommon/zfs_prop.c
Original file line number Diff line number Diff line change
Expand Up @@ -1007,7 +1007,7 @@ EXPORT_SYMBOL(zfs_kfpu_fpregs);
#endif /* defined(HAVE_KERNEL_FPU_INTERNAL) */

extern int __init zcommon_init(void);
extern void __exit zcommon_fini(void);
extern void zcommon_fini(void);

int __init
zcommon_init(void)
Expand All @@ -1021,7 +1021,7 @@ zcommon_init(void)
return (0);
}

void __exit
void
zcommon_fini(void)
{
fletcher_4_fini();
Expand Down
6 changes: 3 additions & 3 deletions module/zstd/zfs_zstd.c
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ zstd_meminit(void)
}

/* Release object from pool and free memory */
static void __exit
static void
release_pool(struct zstd_pool *pool)
{
mutex_destroy(&pool->barrier);
Expand All @@ -712,7 +712,7 @@ release_pool(struct zstd_pool *pool)
}

/* Release memory pool objects */
static void __exit
static void
zstd_mempool_deinit(void)
{
for (int i = 0; i < ZSTD_POOL_MAX; i++) {
Expand Down Expand Up @@ -758,7 +758,7 @@ zstd_init(void)
return (0);
}

extern void __exit
extern void
zstd_fini(void)
{
/* Deinitialize kstat */
Expand Down

0 comments on commit f5456a2

Please sign in to comment.