Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 35b81539 authored by Pablo Neira Ayuso's avatar Pablo Neira Ayuso
Browse files

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: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent d6b3347b
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -224,13 +224,13 @@ 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);

	register_netdevice_notifier(&nf_tables_netdev_notifier);

		return ret;
	}
	register_netdevice_notifier(&nf_tables_netdev_notifier);
	return 0;
}

static void __exit nf_tables_netdev_exit(void)
{