diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2016-01-18 07:52:29 -0500 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2016-01-18 07:53:37 -0500 |
commit | 35b815392a6b6c268baf3b63d7f2ba350597024f (patch) | |
tree | a4070c126591fe62f79e7bfcafaf89d8f07fde73 /net | |
parent | d6b3347bf178266259af64b1f27b5cf54acf62c8 (diff) |
netfilter: nf_tables_netdev: fix error path in module initialization
Unregister the chain type and return error, otherwise this leaks the
subscription to the netdevice notifier call chain.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/netfilter/nf_tables_netdev.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/netfilter/nf_tables_netdev.c b/net/netfilter/nf_tables_netdev.c index b6605e000801..5eefe4a355c6 100644 --- a/net/netfilter/nf_tables_netdev.c +++ b/net/netfilter/nf_tables_netdev.c | |||
@@ -224,12 +224,12 @@ static int __init nf_tables_netdev_init(void) | |||
224 | 224 | ||
225 | nft_register_chain_type(&nft_filter_chain_netdev); | 225 | nft_register_chain_type(&nft_filter_chain_netdev); |
226 | ret = register_pernet_subsys(&nf_tables_netdev_net_ops); | 226 | ret = register_pernet_subsys(&nf_tables_netdev_net_ops); |
227 | if (ret < 0) | 227 | if (ret < 0) { |
228 | nft_unregister_chain_type(&nft_filter_chain_netdev); | 228 | nft_unregister_chain_type(&nft_filter_chain_netdev); |
229 | 229 | return ret; | |
230 | } | ||
230 | register_netdevice_notifier(&nf_tables_netdev_notifier); | 231 | register_netdevice_notifier(&nf_tables_netdev_notifier); |
231 | 232 | return 0; | |
232 | return ret; | ||
233 | } | 233 | } |
234 | 234 | ||
235 | static void __exit nf_tables_netdev_exit(void) | 235 | static void __exit nf_tables_netdev_exit(void) |