Re: [PATCH] [net/ipv6] Remove redundant null check in ah_mt6

2020-07-03 Thread Pablo Neira Ayuso
Hi Gaurav,

On Wed, Jun 24, 2020 at 10:36:25PM -0400, Gaurav Singh wrote:
> ah cannot be NULL since its already checked above after
> assignment and is being dereferenced before in pr().
> Remove the redundant null check.

Could you collapse all your patches into one?

They look like the same logic change (patch description is the same in
the four patches in the series).

Please, prepend netfilter: to your patch subject, I suggest the
following subject for the collapsed patch.

netfilter: ip6tables: Remove redundant null checks

Thanks.


[PATCH] [net/ipv6] Remove redundant null check in ah_mt6

2020-06-24 Thread Gaurav Singh
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 
---
 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