Skip to contentSkip to conversation

Remove redundant null check in hbh_mt6

PATCH New Gaurav Singh 1 participant 1 message Jun 25, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Remove redundant null check in hbh_mt6

oh cannot be NULL since its already checked above after assignment and is being dereferenced before. Remove the redundant null check.

---
 net/ipv6/netfilter/ip6t_hbh.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
net/ipv6/netfilter/ip6t_hbh.c +1 -2
index 467b2a86031b..e7a3fb9355ee 100644
@@ -86,8 +86,7 @@ hbh_mt6(const struct sk_buff *skb, struct xt_action_param *par)
 		  ((optinfo->hdrlen == hdrlen) ^
 		   !!(optinfo->invflags & IP6T_OPTS_INV_LEN))));
 
-	ret = (oh != NULL) &&
-	      (!(optinfo->flags & IP6T_OPTS_LEN) ||
+	ret = (!(optinfo->flags & IP6T_OPTS_LEN) ||
 	       ((optinfo->hdrlen == hdrlen) ^
 		!!(optinfo->invflags & IP6T_OPTS_INV_LEN)));
 
Signature · 1 line
2.17.1