netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next/netfilter] netfilter: nft_inner: fix IS_ERR() vs NULL check
@ 2022-11-15 12:56 Dan Carpenter
  0 siblings, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2022-11-15 12:56 UTC (permalink / raw)
  To: Pablo Neira Ayuso
  Cc: Jozsef Kadlecsik, Florian Westphal, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, netfilter-devel, coreteam, netdev,
	kernel-janitors

The __nft_expr_type_get() function returns NULL on error.  It never
returns error pointers.

Fixes: 3a07327d10a0 ("netfilter: nft_inner: support for inner tunnel header matching")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
This applies to net-next but presumably it's going to go through the
netfilter tree?

 net/netfilter/nf_tables_api.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index 62da204eed41..6b159494c86b 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -2873,8 +2873,8 @@ int nft_expr_inner_parse(const struct nft_ctx *ctx, const struct nlattr *nla,
 		return -EINVAL;
 
 	type = __nft_expr_type_get(ctx->family, tb[NFTA_EXPR_NAME]);
-	if (IS_ERR(type))
-		return PTR_ERR(type);
+	if (!type)
+		return -ENOENT;
 
 	if (!type->inner_ops)
 		return -EOPNOTSUPP;
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH net-next/netfilter] netfilter: nft_inner: fix IS_ERR() vs NULL check
@ 2022-11-15 13:26 Dan Carpenter
  2022-11-22 21:30 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2022-11-15 13:26 UTC (permalink / raw)
  To: Pablo Neira Ayuso
  Cc: Jozsef Kadlecsik, Florian Westphal, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, netfilter-devel, coreteam, netdev,
	kernel-janitors

The __nft_expr_type_get() function returns NULL on error.  It never
returns error pointers.

Fixes: 3a07327d10a0 ("netfilter: nft_inner: support for inner tunnel header matching")
Signed-off-by: Dan Carpenter <error27@gmail.com>
---
This applies to net-next but presumably it's going to go through the
netfilter tree?

 net/netfilter/nf_tables_api.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index 62da204eed41..6b159494c86b 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -2873,8 +2873,8 @@ int nft_expr_inner_parse(const struct nft_ctx *ctx, const struct nlattr *nla,
 		return -EINVAL;
 
 	type = __nft_expr_type_get(ctx->family, tb[NFTA_EXPR_NAME]);
-	if (IS_ERR(type))
-		return PTR_ERR(type);
+	if (!type)
+		return -ENOENT;
 
 	if (!type->inner_ops)
 		return -EOPNOTSUPP;
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next/netfilter] netfilter: nft_inner: fix IS_ERR() vs NULL check
  2022-11-15 13:26 Dan Carpenter
@ 2022-11-22 21:30 ` Pablo Neira Ayuso
  0 siblings, 0 replies; 3+ messages in thread
From: Pablo Neira Ayuso @ 2022-11-22 21:30 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Jozsef Kadlecsik, Florian Westphal, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, netfilter-devel, coreteam, netdev,
	kernel-janitors

On Tue, Nov 15, 2022 at 04:26:07PM +0300, Dan Carpenter wrote:
> The __nft_expr_type_get() function returns NULL on error.  It never
> returns error pointers.

Applied to nf-next, thanks

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-11-22 21:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-15 12:56 [PATCH net-next/netfilter] netfilter: nft_inner: fix IS_ERR() vs NULL check Dan Carpenter
  -- strict thread matches above, loose matches on Subject: below --
2022-11-15 13:26 Dan Carpenter
2022-11-22 21:30 ` 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).