summaryrefslogtreecommitdiff
path: root/net/netfilter
diff options
context:
space:
mode:
authorGao Feng <fgao@ikuai8.com>2016-09-10 10:04:30 +0800
committerPablo Neira Ayuso <pablo@netfilter.org>2016-09-12 19:54:45 +0200
commit23d07508d25cea9984ee068538b4e86932b015c2 (patch)
tree833a38e0a77fe244b9a5ca0f41c571f97d411db2 /net/netfilter
parent4e6577de71803142d01e374cf15664af0388799a (diff)
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>
Diffstat (limited to 'net/netfilter')
-rw-r--r--net/netfilter/nf_tables_inet.c5
-rw-r--r--net/netfilter/nf_tables_netdev.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/net/netfilter/nf_tables_inet.c b/net/netfilter/nf_tables_inet.c
index 6b5f76295d3d..f713cc205669 100644
--- a/net/netfilter/nf_tables_inet.c
+++ b/net/netfilter/nf_tables_inet.c
@@ -82,7 +82,10 @@ static int __init nf_tables_inet_init(void)
{
int ret;
- nft_register_chain_type(&filter_inet);
+ ret = nft_register_chain_type(&filter_inet);
+ if (ret < 0)
+ return ret;
+
ret = register_pernet_subsys(&nf_tables_inet_net_ops);
if (ret < 0)
nft_unregister_chain_type(&filter_inet);
diff --git a/net/netfilter/nf_tables_netdev.c b/net/netfilter/nf_tables_netdev.c
index 38a3e8385042..9e2ae424b640 100644
--- a/net/netfilter/nf_tables_netdev.c
+++ b/net/netfilter/nf_tables_netdev.c
@@ -149,7 +149,10 @@ static int __init nf_tables_netdev_init(void)
{
int ret;
- nft_register_chain_type(&nft_filter_chain_netdev);
+ ret = nft_register_chain_type(&nft_filter_chain_netdev);
+ if (ret)
+ return ret;
+
ret = register_pernet_subsys(&nf_tables_netdev_net_ops);
if (ret)
goto err1;