mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-13 08:46:45 +07:00
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>
This commit is contained in:
parent
d6b3347bf1
commit
35b815392a
@ -224,12 +224,12 @@ static int __init nf_tables_netdev_init(void)
|
|||||||
|
|
||||||
nft_register_chain_type(&nft_filter_chain_netdev);
|
nft_register_chain_type(&nft_filter_chain_netdev);
|
||||||
ret = register_pernet_subsys(&nf_tables_netdev_net_ops);
|
ret = register_pernet_subsys(&nf_tables_netdev_net_ops);
|
||||||
if (ret < 0)
|
if (ret < 0) {
|
||||||
nft_unregister_chain_type(&nft_filter_chain_netdev);
|
nft_unregister_chain_type(&nft_filter_chain_netdev);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
register_netdevice_notifier(&nf_tables_netdev_notifier);
|
register_netdevice_notifier(&nf_tables_netdev_notifier);
|
||||||
|
return 0;
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __exit nf_tables_netdev_exit(void)
|
static void __exit nf_tables_netdev_exit(void)
|
||||||
|
Loading…
Reference in New Issue
Block a user