diff mbox series

[iptables,01/14] xtables: Review unclear return points

Message ID 20181211105042.18703-2-phil@nwl.cc
State Changes Requested
Delegated to: Pablo Neira
Headers show
Series Separate rule cache per chain et al. | expand

Commit Message

Phil Sutter Dec. 11, 2018, 10:50 a.m. UTC
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>
---
 iptables/nft.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/iptables/nft.c b/iptables/nft.c
index 7b6fb2b10686d..e7a56778f8004 100644
--- a/iptables/nft.c
+++ b/iptables/nft.c
@@ -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)
@@ -2454,7 +2454,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)