aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2014-01-09 14:32:19 -0500
committerPablo Neira Ayuso <pablo@netfilter.org>2014-01-09 17:25:48 -0500
commitcf4dfa85395ebe2769267a072b39e48301669842 (patch)
tree92978b3f3a0088763a7a683166c1b25c8883cea2 /net/ipv6
parent3876d22dba62ebf6582f33e1ef2160eeb95e1129 (diff)
netfilter: nf_tables: fix error path in the init functions
We have to unregister chain type if this fails to register netns. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/netfilter/nf_tables_ipv6.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/net/ipv6/netfilter/nf_tables_ipv6.c b/net/ipv6/netfilter/nf_tables_ipv6.c
index 59a43b474dca..0d812b31277d 100644
--- a/net/ipv6/netfilter/nf_tables_ipv6.c
+++ b/net/ipv6/netfilter/nf_tables_ipv6.c
@@ -104,8 +104,14 @@ static const struct nf_chain_type filter_ipv6 = {
104 104
105static int __init nf_tables_ipv6_init(void) 105static int __init nf_tables_ipv6_init(void)
106{ 106{
107 int ret;
108
107 nft_register_chain_type(&filter_ipv6); 109 nft_register_chain_type(&filter_ipv6);
108 return register_pernet_subsys(&nf_tables_ipv6_net_ops); 110 ret = register_pernet_subsys(&nf_tables_ipv6_net_ops);
111 if (ret < 0)
112 nft_unregister_chain_type(&filter_ipv6);
113
114 return ret;
109} 115}
110 116
111static void __exit nf_tables_ipv6_exit(void) 117static void __exit nf_tables_ipv6_exit(void)