netfilter: Add the missed return value check of nft_register_chain_type
There are some codes of netfilter module which did not check the return value of nft_register_chain_type. Add the checks now. Signed-off-by: Gao Feng <fgao@ikuai8.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:

committed by
Pablo Neira Ayuso

parent
4e6577de71
commit
23d07508d2
@@ -80,7 +80,10 @@ static int __init nf_tables_arp_init(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
nft_register_chain_type(&filter_arp);
|
||||
ret = nft_register_chain_type(&filter_arp);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
ret = register_pernet_subsys(&nf_tables_arp_net_ops);
|
||||
if (ret < 0)
|
||||
nft_unregister_chain_type(&filter_arp);
|
||||
|
@@ -103,7 +103,10 @@ static int __init nf_tables_ipv4_init(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
nft_register_chain_type(&filter_ipv4);
|
||||
ret = nft_register_chain_type(&filter_ipv4);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
ret = register_pernet_subsys(&nf_tables_ipv4_net_ops);
|
||||
if (ret < 0)
|
||||
nft_unregister_chain_type(&filter_ipv4);
|
||||
|
Reference in New Issue
Block a user