From 018a3d4acbf441a67d410f5215903ab65b536a06 Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Sat, 4 Apr 2020 15:53:06 +0800 Subject: [PATCH] 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 --- net/ipv4/inet_diag.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c index e4e1999d93f5..ada7302af59d 100644 --- a/net/ipv4/inet_diag.c +++ b/net/ipv4/inet_diag.c @@ -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 */);