inet_diag: Call inet_diag_init() early when CONFIG_INITCALL_ASYNC=y

dccp_diag_init() depends on inet_diag_init() to init inet_diag_table.
But dccp_diag_init() and inet_diag_init() are both in the same
module_init level.

Fix this by moving inet_diag_init() to the rootfs_initcall level.

Change-Id: Ie06bd549622c6f82b34486fc4faaba6c3e4dbba8
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
This commit is contained in:
Tao Huang
2020-04-04 15:53:06 +08:00
parent 267447fac4
commit 018a3d4acb

View File

@@ -1480,7 +1480,11 @@ static void __exit inet_diag_exit(void)
kfree(inet_diag_table);
}
#ifdef CONFIG_INITCALL_ASYNC
rootfs_initcall(inet_diag_init);
#else
module_init(inet_diag_init);
#endif
module_exit(inet_diag_exit);
MODULE_LICENSE("GPL");
MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_NETLINK, NETLINK_SOCK_DIAG, 2 /* AF_INET */);