netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [net/ipv6] Remove redundant null check in ah_mt6
@ 2020-06-25  2:36 Gaurav Singh
  2020-07-04  0:07 ` Pablo Neira Ayuso
  2020-07-27  1:52 ` [PATCH] netfilter: ip6tables: Remove redundant null checks Gaurav Singh
  0 siblings, 2 replies; 4+ messages in thread
From: Gaurav Singh @ 2020-06-25  2:36 UTC (permalink / raw)
  To: gaurav1086, Pablo Neira Ayuso, Jozsef Kadlecsik,
	Florian Westphal, David S. Miller, Alexey Kuznetsov,
	Hideaki YOSHIFUJI, Jakub Kicinski, open list:NETFILTER,
	open list:NETFILTER, open list:NETWORKING [IPv4/IPv6],
	open list

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


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

end of thread, other threads:[~2020-07-29 20:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-25  2:36 [PATCH] [net/ipv6] Remove redundant null check in ah_mt6 Gaurav Singh
2020-07-04  0:07 ` 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

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).