diff options
Diffstat (limited to 'net/ipv6/addrconf.c')
-rw-r--r-- | net/ipv6/addrconf.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 52d10d213217..348bd8d06112 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -255,11 +255,6 @@ static void addrconf_mod_timer(struct inet6_ifaddr *ifp, | |||
255 | 255 | ||
256 | static int snmp6_alloc_dev(struct inet6_dev *idev) | 256 | static int snmp6_alloc_dev(struct inet6_dev *idev) |
257 | { | 257 | { |
258 | int err = -ENOMEM; | ||
259 | |||
260 | if (!idev || !idev->dev) | ||
261 | return -EINVAL; | ||
262 | |||
263 | if (snmp_mib_init((void **)idev->stats.ipv6, | 258 | if (snmp_mib_init((void **)idev->stats.ipv6, |
264 | sizeof(struct ipstats_mib), | 259 | sizeof(struct ipstats_mib), |
265 | __alignof__(struct ipstats_mib)) < 0) | 260 | __alignof__(struct ipstats_mib)) < 0) |
@@ -280,15 +275,14 @@ err_icmpmsg: | |||
280 | err_icmp: | 275 | err_icmp: |
281 | snmp_mib_free((void **)idev->stats.ipv6); | 276 | snmp_mib_free((void **)idev->stats.ipv6); |
282 | err_ip: | 277 | err_ip: |
283 | return err; | 278 | return -ENOMEM; |
284 | } | 279 | } |
285 | 280 | ||
286 | static int snmp6_free_dev(struct inet6_dev *idev) | 281 | static void snmp6_free_dev(struct inet6_dev *idev) |
287 | { | 282 | { |
288 | snmp_mib_free((void **)idev->stats.icmpv6msg); | 283 | snmp_mib_free((void **)idev->stats.icmpv6msg); |
289 | snmp_mib_free((void **)idev->stats.icmpv6); | 284 | snmp_mib_free((void **)idev->stats.icmpv6); |
290 | snmp_mib_free((void **)idev->stats.ipv6); | 285 | snmp_mib_free((void **)idev->stats.ipv6); |
291 | return 0; | ||
292 | } | 286 | } |
293 | 287 | ||
294 | /* Nobody refers to this device, we may destroy it. */ | 288 | /* Nobody refers to this device, we may destroy it. */ |