Skip to content

Commit

Permalink
netfilter: nf_tables_netdev: fix error path in module initialization
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Pablo Neira Ayuso committed Jan 18, 2016
1 parent d6b3347 commit 35b8153
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions net/netfilter/nf_tables_netdev.c
Original file line number Diff line number Diff line change
@@ -224,12 +224,12 @@ static int __init nf_tables_netdev_init(void)

nft_register_chain_type(&nft_filter_chain_netdev);
ret = register_pernet_subsys(&nf_tables_netdev_net_ops);
if (ret < 0)
if (ret < 0) {
nft_unregister_chain_type(&nft_filter_chain_netdev);

return ret;
}
register_netdevice_notifier(&nf_tables_netdev_notifier);

return ret;
return 0;
}

static void __exit nf_tables_netdev_exit(void)

0 comments on commit 35b8153

Please sign in to comment.