Skip to contentSkip to conversation

Remove redundant null check in rt_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 rt_mt6

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

---
 net/ipv6/netfilter/ip6t_rt.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
net/ipv6/netfilter/ip6t_rt.c +1 -2
index f633dc84ca3f..733c83d38b30 100644
@@ -89,8 +89,7 @@ static bool rt_mt6(const struct sk_buff *skb, struct xt_action_param *par)
 		 !((rtinfo->flags & IP6T_RT_RES) &&
 		   (((const struct rt0_hdr *)rh)->reserved)));
 
-	ret = (rh != NULL) &&
-	      (segsleft_match(rtinfo->segsleft[0], rtinfo->segsleft[1],
+	ret = (segsleft_match(rtinfo->segsleft[0], rtinfo->segsleft[1],
 			      rh->segments_left,
 			      !!(rtinfo->invflags & IP6T_RT_INV_SGS))) &&
 	      (!(rtinfo->flags & IP6T_RT_LEN) ||
Signature · 1 line
2.17.1