* [PATCH] netfilter: nf_tables: remove redundant assignment of variable err
@ 2021-01-28 17:59 Colin King
2021-02-03 23:04 ` Pablo Neira Ayuso
0 siblings, 1 reply; 3+ messages in thread
From: Colin King @ 2021-01-28 17:59 UTC (permalink / raw)
To: Pablo Neira Ayuso, Jozsef Kadlecsik, Florian Westphal,
David S . Miller, Jakub Kicinski, netfilter-devel, coreteam,
netdev
Cc: kernel-janitors, linux-kernel
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>
---
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] netfilter: nf_tables: remove redundant assignment of variable err
2021-01-28 17:59 [PATCH] netfilter: nf_tables: remove redundant assignment of variable err Colin King
@ 2021-02-03 23:04 ` Pablo Neira Ayuso
2021-02-03 23:58 ` Pablo Neira Ayuso
0 siblings, 1 reply; 3+ messages in thread
From: Pablo Neira Ayuso @ 2021-02-03 23:04 UTC (permalink / raw)
To: Colin King
Cc: Jozsef Kadlecsik, Florian Westphal, David S . Miller,
Jakub Kicinski, netfilter-devel, coreteam, netdev,
kernel-janitors, linux-kernel
On Thu, Jan 28, 2021 at 05:59:23PM +0000, Colin King wrote:
> 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.
Applied to nf, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] netfilter: nf_tables: remove redundant assignment of variable err
2021-02-03 23:04 ` Pablo Neira Ayuso
@ 2021-02-03 23:58 ` Pablo Neira Ayuso
0 siblings, 0 replies; 3+ messages in thread
From: Pablo Neira Ayuso @ 2021-02-03 23:58 UTC (permalink / raw)
To: Colin King
Cc: Jozsef Kadlecsik, Florian Westphal, David S . Miller,
Jakub Kicinski, netfilter-devel, coreteam, netdev,
kernel-janitors, linux-kernel
On Thu, Feb 04, 2021 at 12:04:21AM +0100, Pablo Neira Ayuso wrote:
> On Thu, Jan 28, 2021 at 05:59:23PM +0000, Colin King wrote:
> > 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.
>
> Applied to nf, thanks.
Sorry, I meant, nf-next
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-02-03 23:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-28 17:59 [PATCH] netfilter: nf_tables: remove redundant assignment of variable err Colin King
2021-02-03 23:04 ` Pablo Neira Ayuso
2021-02-03 23:58 ` Pablo Neira Ayuso
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).