netfilter: Fix ip_conntrack_proto_sctp exit on sysctl fail
Subsystems (2)
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
Signed-off-by Rusty Russell <[email protected]>
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
@@ -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