]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
xtables: Drop pointless check
authorPhil Sutter <phil@nwl.cc>
Wed, 19 Sep 2018 13:17:08 +0000 (15:17 +0200)
committerFlorian Westphal <fw@strlen.de>
Mon, 24 Sep 2018 09:50:03 +0000 (11:50 +0200)
All commands this block handles set p->chain. Also the pointer is
dereferenced before, so no point in checking for it to be non-NULL.

Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Florian Westphal <fw@strlen.de>
iptables/xtables.c

index 313b985bbaa85739998c6fca5824484758f428d8..d6afada94c6e78908ac0c4a9a243ef6b6baaa175 100644 (file)
@@ -1160,7 +1160,7 @@ void do_parse(struct nft_handle *h, int argc, char *argv[],
                                           p->chain);
                }
 
-               if (p->chain && !nft_chain_exists(h, p->table, p->chain))
+               if (!nft_chain_exists(h, p->table, p->chain))
                        xtables_error(OTHER_PROBLEM,
                                      "Chain '%s' does not exist", cs->jumpto);