提交 aaf70ec7 编写于 作者: P Pavel Emelyanov 提交者: David S. Miller

[IPV6]: Cleanup snmp6_alloc_dev()

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: NPavel Emelyanov <xemul@openvz.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 16910b98
...@@ -255,11 +255,6 @@ static void addrconf_mod_timer(struct inet6_ifaddr *ifp, ...@@ -255,11 +255,6 @@ static void addrconf_mod_timer(struct inet6_ifaddr *ifp,
static int snmp6_alloc_dev(struct inet6_dev *idev) 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, if (snmp_mib_init((void **)idev->stats.ipv6,
sizeof(struct ipstats_mib), sizeof(struct ipstats_mib),
__alignof__(struct ipstats_mib)) < 0) __alignof__(struct ipstats_mib)) < 0)
...@@ -280,7 +275,7 @@ static int snmp6_alloc_dev(struct inet6_dev *idev) ...@@ -280,7 +275,7 @@ static int snmp6_alloc_dev(struct inet6_dev *idev)
err_icmp: err_icmp:
snmp_mib_free((void **)idev->stats.ipv6); snmp_mib_free((void **)idev->stats.ipv6);
err_ip: err_ip:
return err; return -ENOMEM;
} }
static void snmp6_free_dev(struct inet6_dev *idev) static void snmp6_free_dev(struct inet6_dev *idev)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册