Skip to contentSkip to conversation

ipv6: remove superfluous nla_data() NULL pointer checks

PATCH Applied Mathias Krause 2 participants 2 messages Mar 9, 2013 – Mar 10, 2013

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

PATCH 1/1 ipv6: remove superfluous nla_data() NULL pointer checks

nla_data() cannot return NULL, so these NULL pointer checks are superfluous.

---
 net/ipv6/addrlabel.c |    6 ------
 1 file changed, 6 deletions(-)
net/ipv6/addrlabel.c +0 -6
index aad6435..6f226c8 100644
@@ -436,10 +436,7 @@ static int ip6addrlbl_newdel(struct sk_buff *skb, struct nlmsghdr *nlh,
 
 	if (!tb[IFAL_ADDRESS])
 		return -EINVAL;
-
 	pfx = nla_data(tb[IFAL_ADDRESS]);
-	if (!pfx)
-		return -EINVAL;
 
 	if (!tb[IFAL_LABEL])
 		return -EINVAL;
@@ -561,10 +558,7 @@ static int ip6addrlbl_get(struct sk_buff *in_skb, struct nlmsghdr* nlh,
 
 	if (!tb[IFAL_ADDRESS])
 		return -EINVAL;
-
 	addr = nla_data(tb[IFAL_ADDRESS]);
-	if (!addr)
-		return -EINVAL;
 
 	rcu_read_lock();
 	p = __ipv6_addr_label(net, addr, ipv6_addr_type(addr), ifal->ifal_index);
Signature · 1 line
1.7.10.4