netfilter: nft_inner: fix IS_ERR() vs NULL check
Subsystems (4)
PATCH 1/1 netfilter: nft_inner: fix IS_ERR() vs NULL check
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 <[email protected]>
---
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(-)
net/netfilter/nf_tables_api.c +2 -2
@@ -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 ;
Signature · 1 line
2.35.1