ipv6: remove superfluous nla_data() NULL pointer checks
authorMathias Krause <minipli@googlemail.com>
Sat, 9 Mar 2013 05:57:00 +0000 (05:57 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sun, 10 Mar 2013 20:46:09 +0000 (16:46 -0400)
nla_data() cannot return NULL, so these NULL pointer checks are
superfluous.

Signed-off-by: Mathias Krause <minipli@googlemail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/addrlabel.c

index aad64352cb60699d20c3d071fa81f3cc1bf8ee30..6f226c850c911cc59dea39aaa4d78f8516b3aa8f 100644 (file)
@@ -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);