From: Gaurav Singh <gaurav1086@gmail.com>
To: gaurav1086@gmail.com, Pablo Neira Ayuso <pablo@netfilter.org>,
Jozsef Kadlecsik <kadlec@netfilter.org>,
Florian Westphal <fw@strlen.de>,
"David S. Miller" <davem@davemloft.net>,
Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>,
Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>,
Jakub Kicinski <kuba@kernel.org>,
netfilter-devel@vger.kernel.org (open list:NETFILTER),
coreteam@netfilter.org (open list:NETFILTER),
netdev@vger.kernel.org (open list:NETWORKING [IPv4/IPv6]),
linux-kernel@vger.kernel.org (open list)
Subject: [PATCH] [net/ipv6] Remove redundant null check in ah_mt6
Date: Wed, 24 Jun 2020 22:36:25 -0400 [thread overview]
Message-ID: <20200625023626.32557-1-gaurav1086@gmail.com> (raw)
ah cannot be NULL since its already checked above after
assignment and is being dereferenced before in pr().
Remove the redundant null check.
Signed-off-by: Gaurav Singh <gaurav1086@gmail.com>
---
net/ipv6/netfilter/ip6t_ah.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/net/ipv6/netfilter/ip6t_ah.c b/net/ipv6/netfilter/ip6t_ah.c
index 4e15a14435e4..70da2f2ce064 100644
--- a/net/ipv6/netfilter/ip6t_ah.c
+++ b/net/ipv6/netfilter/ip6t_ah.c
@@ -74,8 +74,7 @@ static bool ah_mt6(const struct sk_buff *skb, struct xt_action_param *par)
ahinfo->hdrres, ah->reserved,
!(ahinfo->hdrres && ah->reserved));
- return (ah != NULL) &&
- spi_match(ahinfo->spis[0], ahinfo->spis[1],
+ return spi_match(ahinfo->spis[0], ahinfo->spis[1],
ntohl(ah->spi),
!!(ahinfo->invflags & IP6T_AH_INV_SPI)) &&
(!ahinfo->hdrlen ||
--
2.17.1
next reply other threads:[~2020-06-25 2:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-25 2:36 Gaurav Singh [this message]
2020-07-04 0:07 ` [PATCH] [net/ipv6] Remove redundant null check in ah_mt6 Pablo Neira Ayuso
2020-07-27 1:52 ` [PATCH] netfilter: ip6tables: Remove redundant null checks Gaurav Singh
2020-07-29 20:44 ` Pablo Neira Ayuso
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=20200625023626.32557-1-gaurav1086@gmail.com \
--to=gaurav1086@gmail.com \
--cc=coreteam@netfilter.org \
--cc=davem@davemloft.net \
--cc=fw@strlen.de \
--cc=kadlec@netfilter.org \
--cc=kuba@kernel.org \
--cc=kuznet@ms2.inr.ac.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
--cc=yoshfuji@linux-ipv6.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 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).