Skip to contentSkip to conversation

remove redundant null check in frag_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 frag_mt6

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

---
 net/ipv6/netfilter/ip6t_frag.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
net/ipv6/netfilter/ip6t_frag.c +1 -2
index fb91eeee4a1e..3aad6439386b 100644
@@ -85,8 +85,7 @@ frag_mt6(const struct sk_buff *skb, struct xt_action_param *par)
 		 !((fraginfo->flags & IP6T_FRAG_NMF) &&
 		   (ntohs(fh->frag_off) & IP6_MF)));
 
-	return (fh != NULL) &&
-		id_match(fraginfo->ids[0], fraginfo->ids[1],
+	return id_match(fraginfo->ids[0], fraginfo->ids[1],
 			 ntohl(fh->identification),
 			 !!(fraginfo->invflags & IP6T_FRAG_INV_IDS)) &&
 		!((fraginfo->flags & IP6T_FRAG_RES) &&
Signature · 1 line
2.17.1