Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1190786pxb; Thu, 28 Jan 2021 10:02:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJyivIbrZRpJGleWGHX0YEsBfSCt6FJtwoese/SVqBrvczMDeoQLP8m7rY68Q92pdkQUWCA7 X-Received: by 2002:a05:6402:1e5:: with SMTP id i5mr901519edy.86.1611856955416; Thu, 28 Jan 2021 10:02:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611856955; cv=none; d=google.com; s=arc-20160816; b=IdJuGYO/uzQem0X+aAN0CR/peHbWiLT6b0ND/CNowdEYhYD3qzaIXWWXVuK4td8bon uySxNM8Le97sL924pbrWNmazy6MGHJN77VRUEDa1bGaFMP3FJ+UzdsBrALjjyRFCskMr KyTp+jjsL7x3gzj8XIH6gorWbBaS0strPMAIkMqC4R5aatABUHicBHv5twJGNGp3RH4m RJ1NNYzNH2v2N+HcuNTy8OEaHuepoKpiBYVaGyTylOhGpbcbBP63m7pVbAZALAQwoKTj zLfhkNktEzVnIcqGgtiM29foo3RtMR5DIX/2BxzEqAnwOOvyewRLR58nC1CFanbW9/jl H6dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=257s1IY8W8/Cds1CuTO+j2ItIiq9HwMjqPgrY8lJ/A4=; b=nvHz/ZsqfD1RLdvEHh1eO2dhJZnuM1Hc+v2I8jE+fS7EUA6wLeNINxTGaxO1dEun5o fsCEhZ5AZDiVbA6lNpLOn45Am0G0nSQ7+4dM9NjdDubDvkiRAojy02e8Gr6i0NReH3k/ lVPajwPLfJZYtENSKGvKApGELD1am0NPaFZg18GhGPMUFOdmy7MziS/evOCL3mCmH2C+ U0xN5urJWYhXsnmnpNBOqzFPR/38ubIpK2pn78pI4y1D0H+fu9zmlL4N2Dp1zIIu3qr7 cbB72QE8YNf0keNwlKGZcSeva3Yw9X3R9O1MUVV3WPXX0S7labOj94ZDkGjUibUxhSxC XZ+Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t1si3451552edw.114.2021.01.28.10.02.11; Thu, 28 Jan 2021 10:02:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231350AbhA1SBX (ORCPT + 99 others); Thu, 28 Jan 2021 13:01:23 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:47992 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231420AbhA1SAK (ORCPT ); Thu, 28 Jan 2021 13:00:10 -0500 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1l5BZj-0000Zw-LC; Thu, 28 Jan 2021 17:59:23 +0000 From: Colin King To: Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal , "David S . Miller" , Jakub Kicinski , netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] netfilter: nf_tables: remove redundant assignment of variable err Date: Thu, 28 Jan 2021 17:59:23 +0000 Message-Id: <20210128175923.645865-1-colin.king@canonical.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin Ian King 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 --- 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 00e563a72d3d..acbabffefebb 100644 --- a/net/netfilter/nft_cmp.c +++ b/net/netfilter/nft_cmp.c @@ -268,10 +268,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.29.2