]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
nft: Review unclear return points
authorPhil Sutter <phil@nwl.cc>
Thu, 20 Dec 2018 15:09:03 +0000 (16:09 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 26 Dec 2018 10:17:37 +0000 (11:17 +0100)
When converting to per table chain caches, these two error returns were
marked for review but apparently forgotten. Make sure error condition is
propagated when returning at those points.

Fixes: c58ecf9f8bcb7 ("xtables: Introduce per table chain caches")
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
iptables/nft.c

index 9d20eb0eac2db4049d5701dae0535b32fe5884be..1fca1f17147f6d70969e02e83d5f69b25ffefdd3 100644 (file)
@@ -2311,7 +2311,7 @@ int nft_rule_list(struct nft_handle *h, const char *chain, const char *table,
 
        list = nft_chain_list_get(h, table);
        if (!list)
-               goto err; /* XXX: return 0 instead? */
+               return 0;
 
        iter = nftnl_chain_list_iter_create(list);
        if (iter == NULL)
@@ -2450,7 +2450,7 @@ int nft_rule_list_save(struct nft_handle *h, const char *chain,
 
        list = nft_chain_list_get(h, table);
        if (!list)
-               goto err; /* XXX: correct? */
+               goto err;
 
        /* Dump policies and custom chains first */
        if (!rulenum)