Commit 5ea39dfb authored by Rusty Russell's avatar Rusty Russell Committed by Linus Torvalds

[PATCH] netfilter: Fix ip_conntrack_proto_sctp exit on sysctl fail

On failure from register_sysctl_table, we return with exit 0.  Oops.  init and
fini should also be static.  nfsim found these.
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent a9dcd00e
...@@ -609,7 +609,7 @@ static ctl_table ip_ct_net_table[] = { ...@@ -609,7 +609,7 @@ static ctl_table ip_ct_net_table[] = {
static struct ctl_table_header *ip_ct_sysctl_header; static struct ctl_table_header *ip_ct_sysctl_header;
#endif #endif
int __init init(void) static int __init init(void)
{ {
int ret; int ret;
...@@ -622,6 +622,7 @@ int __init init(void) ...@@ -622,6 +622,7 @@ int __init init(void)
#ifdef CONFIG_SYSCTL #ifdef CONFIG_SYSCTL
ip_ct_sysctl_header = register_sysctl_table(ip_ct_net_table, 0); ip_ct_sysctl_header = register_sysctl_table(ip_ct_net_table, 0);
if (ip_ct_sysctl_header == NULL) { if (ip_ct_sysctl_header == NULL) {
ret = -ENOMEM;
printk("ip_conntrack_proto_sctp: can't register to sysctl.\n"); printk("ip_conntrack_proto_sctp: can't register to sysctl.\n");
goto cleanup; goto cleanup;
} }
...@@ -639,7 +640,7 @@ int __init init(void) ...@@ -639,7 +640,7 @@ int __init init(void)
return ret; return ret;
} }
void __exit fini(void) static void __exit fini(void)
{ {
ip_conntrack_protocol_unregister(&ip_conntrack_protocol_sctp); ip_conntrack_protocol_unregister(&ip_conntrack_protocol_sctp);
#ifdef CONFIG_SYSCTL #ifdef CONFIG_SYSCTL
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment