From 5eb9313c1659fed3dbf939fec13aa16ab4059369 Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Tue, 1 Apr 2025 16:46:02 +0800 Subject: [PATCH] genetlink: Call genl_init() later when CONFIG_INITCALL_ASYNC=y genl_init() depends on netlink_proto_init() to init nl_table. But genl_init() and netlink_proto_init() are both in the same core_initcall level. Fix this by moving genl_init() to the core_initcall_sync level, which is earlier than thermal_init(). Change-Id: Id4c85ea069c6ce3ebcb632856b695018bcc1e981 Signed-off-by: Tao Huang --- net/netlink/genetlink.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c index fd3c1f1ca6ea..5b2ae536075d 100644 --- a/net/netlink/genetlink.c +++ b/net/netlink/genetlink.c @@ -1494,7 +1494,11 @@ problem: panic("GENL: Cannot register controller: %d\n", err); } +#ifdef CONFIG_INITCALL_ASYNC +core_initcall_sync(genl_init); +#else core_initcall(genl_init); +#endif static int genlmsg_mcast(struct sk_buff *skb, u32 portid, unsigned long group) {