Re: [PATCH] net: netrom: Fix error cleanup path of nr_proto_init

From: David Miller
Date: Mon Apr 08 2019 - 19:35:03 EST


From: Yue Haibing <yuehaibing@xxxxxxxxxx>
Date: Mon, 8 Apr 2019 23:12:00 +0800

> From: YueHaibing <yuehaibing@xxxxxxxxxx>
>
> Syzkaller report this:

This doesn't compile:

WARNING: net/netrom/netrom.o(.init.text+0x404): Section mismatch in reference from the function init_module() to the function .exit.text:nr_loopback_clear()
The function __init init_module() references
a function __exit nr_loopback_clear().
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
nr_loopback_clear() so it may be used outside an exit section.

WARNING: net/netrom/netrom.o(.init.text+0x409): Section mismatch in reference from the function init_module() to the function .exit.text:nr_rt_free()
The function __init init_module() references
a function __exit nr_rt_free().
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
nr_rt_free() so it may be used outside an exit section.