[IPV6]: Cleanup snmp6_alloc_dev()
authorPavel Emelyanov <xemul@openvz.org>
Thu, 18 Oct 2007 04:25:32 +0000 (21:25 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 18 Oct 2007 04:25:32 +0000 (21:25 -0700)
This functions is never called with NULL or not setup argument,
so the checks inside are redundant.

Also, the return value is always -ENOMEM, so no need in
additional variable for this.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/addrconf.c

index edf06ca347496f1d53deb473b6768a5d3a47eca7..348bd8d061125f61932c74d683e6a3f8d69c28e6 100644 (file)
@@ -255,11 +255,6 @@ static void addrconf_mod_timer(struct inet6_ifaddr *ifp,
 
 static int snmp6_alloc_dev(struct inet6_dev *idev)
 {
-       int err = -ENOMEM;
-
-       if (!idev || !idev->dev)
-               return -EINVAL;
-
        if (snmp_mib_init((void **)idev->stats.ipv6,
                          sizeof(struct ipstats_mib),
                          __alignof__(struct ipstats_mib)) < 0)
@@ -280,7 +275,7 @@ err_icmpmsg:
 err_icmp:
        snmp_mib_free((void **)idev->stats.ipv6);
 err_ip:
-       return err;
+       return -ENOMEM;
 }
 
 static void snmp6_free_dev(struct inet6_dev *idev)