Skip to content

Commit

Permalink
netfilter: nftables: remove redundant assignment of variable err
Browse files Browse the repository at this point in the history
The variable err is being assigned a value that is never read,
the same error number is being returned at the error return
path via label err1.  Clean up the code by removing the assignment.

Addresses-Coverity: ("Unused value")
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 ummakynes committed Feb 6, 2021
1 parent 08a01c1 commit 626899a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions net/netfilter/nft_cmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,10 +266,8 @@ nft_cmp_select_ops(const struct nft_ctx *ctx, const struct nlattr * const tb[])
if (err < 0)
return ERR_PTR(err);

if (desc.type != NFT_DATA_VALUE) {
err = -EINVAL;
if (desc.type != NFT_DATA_VALUE)
goto err1;
}

if (desc.len <= sizeof(u32) && (op == NFT_CMP_EQ || op == NFT_CMP_NEQ))
return &nft_cmp_fast_ops;
Expand Down

0 comments on commit 626899a

Please sign in to comment.