Skip to contentSkip to conversation

netfilter: Fix ip_conntrack_proto_sctp exit on sysctl fail

PATCH New Rusty Russell 1 participant 1 message Dec 31, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 2/8 netfilter: Fix ip_conntrack_proto_sctp exit on sysctl fail

Name: Fix ip_conntrack_proto_sctp exit on sysctl fail
Status: Trivial

On failure from register_sysctl_table, we return with exit 0. Oops. init and fini should also be static. nfsim found these.

net/ipv4/netfilter/ip_conntrack_proto_sctp.c +3 -2
Index: linux-2.6.10-bk1-Netfilter/net/ipv4/netfilter/ip_conntrack_proto_sctp.c
===================================================================
@@ -609,7 +609,7 @@
 static struct ctl_table_header *ip_ct_sysctl_header;
 #endif
 
-int __init init(void)
+static int __init init(void)
 {
 	int ret;
 
@@ -622,6 +622,7 @@
 #ifdef CONFIG_SYSCTL
 	ip_ct_sysctl_header = register_sysctl_table(ip_ct_net_table, 0);
 	if (ip_ct_sysctl_header == NULL) {
+		ret = -ENOMEM;
 		printk("ip_conntrack_proto_sctp: can't register to sysctl.\n");
 		goto cleanup;
 	}
@@ -639,7 +640,7 @@
 	return ret;
 }
 
-void __exit fini(void)
+static void __exit fini(void)
 {
 	ip_conntrack_protocol_unregister(&ip_conntrack_protocol_sctp);
 #ifdef CONFIG_SYSCTL
Signature · 1 line
A bad analogy is like a leaky screwdriver -- Richard Braakman