Skip to content

Commit

Permalink
[IPV6]: Cleanup snmp6_alloc_dev()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Pavel Emelyanov authored and David S. Miller committed Oct 18, 2007
1 parent 16910b9 commit aaf70ec
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions net/ipv6/addrconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -280,7 +275,7 @@ static int snmp6_alloc_dev(struct inet6_dev *idev)
err_icmp:
snmp_mib_free((void **)idev->stats.ipv6);
err_ip:
return err;
return -ENOMEM;
}

static void snmp6_free_dev(struct inet6_dev *idev)
Expand Down

0 comments on commit aaf70ec

Please sign in to comment.