Skip to content

Commit

Permalink
netfilter: arp_tables: remove redundant check on ret being non-zero
Browse files Browse the repository at this point in the history
ret is initialized to zero and if it is set to non-zero in the
xt_entry_foreach loop then we exit via the out_free label. Hence
the check for ret being non-zero is redundant and can be removed.

Detected by CoverityScan, CID#1357132 ("Logically Dead Code")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
  • Loading branch information
Colin Ian King authored and Pablo Neira Ayuso committed Mar 6, 2017
1 parent 13fa745 commit 74664cf
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions net/ipv4/netfilter/arp_tables.c
Original file line number Diff line number Diff line change
Expand Up @@ -562,8 +562,6 @@ static int translate_table(struct xt_table_info *newinfo, void *entry0,
XT_ERROR_TARGET) == 0)
++newinfo->stacksize;
}
if (ret != 0)
goto out_free;

ret = -EINVAL;
if (i != repl->num_entries)
Expand Down

0 comments on commit 74664cf

Please sign in to comment.