From: Phil Sutter <phil@nwl.cc>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org
Subject: [nft PATCH 3/3] bison: Drop pointless NULL-check
Date: Wed, 11 Nov 2026 18:01:47 +0100 [thread overview]
Message-ID: <20261111170147.47501-4-phil@nwl.cc> (raw)
In-Reply-To: <20261111170147.47501-1-phil@nwl.cc>
The value returned by basehook_device_name is never NULL since scanner
always sets yyval to an allocated pointer before returning STRING
token.
Fixes: b98fee20bfe23 ("mnl: revisit hook listing")
Signed-off-by: Phil Sutter <phil@nwl.cc>
---
src/parser_bison.y | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/parser_bison.y b/src/parser_bison.y
index 83c0f32322a93..bf2a136796619 100644
--- a/src/parser_bison.y
+++ b/src/parser_bison.y
@@ -1815,10 +1815,8 @@ basehook_spec : ruleset_spec
}
| ruleset_spec basehook_device_name
{
- if ($2) {
- $1.obj.name = $2;
- $1.obj.location = @2;
- }
+ $1.obj.name = $2;
+ $1.obj.location = @2;
$$ = $1;
}
;
--
2.54.0
next prev parent reply other threads:[~2026-11-11 17:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-11 17:01 [nft PATCH 0/3] Fix two leaks in error path, one extra Phil Sutter
2026-11-11 17:01 ` [nft PATCH 1/3] parser_json: Avoid storage leak in json_parse_set_expr error path Phil Sutter
2026-11-11 17:01 ` [nft PATCH 2/3] netlink: Avoid storage leak in tunnel_parse_opt_cb " Phil Sutter
2026-11-11 17:01 ` Phil Sutter [this message]
2026-11-11 20:04 ` [nft PATCH 0/3] Fix two leaks in error path, one extra Florian Westphal
2026-11-11 22:57 ` Phil Sutter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261111170147.47501-4-phil@nwl.cc \
--to=phil@nwl.cc \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.