]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
netfilter: nftables: remove redundant assignment of variable err
authorColin Ian King <colin.king@canonical.com>
Thu, 28 Jan 2021 17:59:23 +0000 (17:59 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 31 Aug 2022 15:15:18 +0000 (17:15 +0200)
[ Upstream commit 626899a02e6afcd4b2ce5c0551092e3554cec4aa ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/netfilter/nft_cmp.c

index b529c0e8654665053deac626794ce1e222abdb09..47b6d05f1ae690c92e217e821af08db4f89a0ca5 100644 (file)
@@ -303,10 +303,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;