Skip to contentSkip to conversation

ipv4 ping: Fix __init* attributes

PATCH In review Andi Kleen 2 participants 2 messages Mar 30, 2019 – Apr 2, 2019

Subsystems (2)
lore
Share & tools
lore

Andi Kleen

author
#0 lore raw

PATCH 1/1 ipv4 ping: Fix __init* attributes

From: Andi Kleen <[email protected]>

ping_v4_net_ops references init functions, so needs to be __initdata. ping_proc_exit is then referenced from __initdata, so also needs to be __init.

---
 net/ipv4/ping.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
net/ipv4/ping.c +2 -2
index 7ccb5f87f70b..070e078612a0 100644
@@ -1160,7 +1160,7 @@ static void __net_exit ping_v4_proc_exit_net(struct net *net)
 	remove_proc_entry("icmp", net->proc_net);
 }
 
-static struct pernet_operations ping_v4_net_ops = {
+static __initdata struct pernet_operations ping_v4_net_ops = {
 	.init = ping_v4_proc_init_net,
 	.exit = ping_v4_proc_exit_net,
 };
@@ -1170,7 +1170,7 @@ int __init ping_proc_init(void)
 	return register_pernet_subsys(&ping_v4_net_ops);
 }
 
-void ping_proc_exit(void)
+void __init ping_proc_exit(void)
 {
 	unregister_pernet_subsys(&ping_v4_net_ops);
 }
Signature · 1 line
2.20.1
maintainer
#1 lore raw

From: Andi Kleen <[email protected]>
Date: Fri, 29 Mar 2019 17:46:00 -0700

Quoted 7 lines

From: Andi Kleen <[email protected]>

ping_v4_net_ops references init functions, so needs to be __initdata. ping_proc_exit is then referenced from __initdata, so also needs to be __init.

How can you spin up new network namespaces properly if you mark this thing __init?

What __init functions does it even reference? It just creates and destroys procfs files.

This patch doesn't seem correct, I'm not applying it.