All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Cc: davem@davemloft.net, netdev@vger.kernel.org, kuba@kernel.org
Subject: [PATCH net-next 7/7] netfilter: nftables: remove redundant assignment of variable err
Date: Sat,  6 Feb 2021 02:50:05 +0100	[thread overview]
Message-ID: <20210206015005.23037-8-pablo@netfilter.org> (raw)
In-Reply-To: <20210206015005.23037-1-pablo@netfilter.org>

From: Colin Ian King <colin.king@canonical.com>

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>
---
 net/netfilter/nft_cmp.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/net/netfilter/nft_cmp.c b/net/netfilter/nft_cmp.c
index 3640eea8a87b..eb6a43a180bb 100644
--- a/net/netfilter/nft_cmp.c
+++ b/net/netfilter/nft_cmp.c
@@ -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;
-- 
2.20.1


      parent reply	other threads:[~2021-02-06  3:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-06  1:49 [PATCH net-next 0/7] Netfilter/IPVS updates for net-next Pablo Neira Ayuso
2021-02-06  1:49 ` [PATCH net-next 1/7] netfilter: ctnetlink: remove get_ct indirection Pablo Neira Ayuso
2021-02-07  0:00   ` patchwork-bot+netdevbpf
2021-02-06  1:50 ` [PATCH net-next 2/7] ipvs: add weighted random twos choice algorithm Pablo Neira Ayuso
2021-02-06  1:50 ` [PATCH net-next 3/7] netfilter: flowtable: add hash offset field to tuple Pablo Neira Ayuso
2021-02-06  1:50 ` [PATCH net-next 4/7] netfilter: nftables: add nft_parse_register_load() and use it Pablo Neira Ayuso
2021-02-06  1:50 ` [PATCH net-next 5/7] netfilter: nftables: add nft_parse_register_store() " Pablo Neira Ayuso
2021-02-06  1:50 ` [PATCH net-next 6/7] netfilter: nftables: statify nft_parse_register() Pablo Neira Ayuso
2021-02-06  1:50 ` Pablo Neira Ayuso [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210206015005.23037-8-pablo@netfilter.org \
    --to=pablo@netfilter.org \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.