aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/af_inet6.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6/af_inet6.c')
-rw-r--r--net/ipv6/af_inet6.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index e8f82eca1609..e09139122efe 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -806,16 +806,12 @@ static int __init init_ipv6_mibs(void)
806 if (snmp_mib_init((void **)icmpv6msg_statistics, 806 if (snmp_mib_init((void **)icmpv6msg_statistics,
807 sizeof(struct icmpv6msg_mib)) < 0) 807 sizeof(struct icmpv6msg_mib)) < 0)
808 goto err_icmpmsg_mib; 808 goto err_icmpmsg_mib;
809 if (snmp_mib_init((void **)udp_stats_in6, sizeof (struct udp_mib)) < 0)
810 goto err_udp_mib;
811 if (snmp_mib_init((void **)udplite_stats_in6, 809 if (snmp_mib_init((void **)udplite_stats_in6,
812 sizeof (struct udp_mib)) < 0) 810 sizeof (struct udp_mib)) < 0)
813 goto err_udplite_mib; 811 goto err_udplite_mib;
814 return 0; 812 return 0;
815 813
816err_udplite_mib: 814err_udplite_mib:
817 snmp_mib_free((void **)udp_stats_in6);
818err_udp_mib:
819 snmp_mib_free((void **)icmpv6msg_statistics); 815 snmp_mib_free((void **)icmpv6msg_statistics);
820err_icmpmsg_mib: 816err_icmpmsg_mib:
821 snmp_mib_free((void **)icmpv6_statistics); 817 snmp_mib_free((void **)icmpv6_statistics);
@@ -831,17 +827,20 @@ static void cleanup_ipv6_mibs(void)
831 snmp_mib_free((void **)ipv6_statistics); 827 snmp_mib_free((void **)ipv6_statistics);
832 snmp_mib_free((void **)icmpv6_statistics); 828 snmp_mib_free((void **)icmpv6_statistics);
833 snmp_mib_free((void **)icmpv6msg_statistics); 829 snmp_mib_free((void **)icmpv6msg_statistics);
834 snmp_mib_free((void **)udp_stats_in6);
835 snmp_mib_free((void **)udplite_stats_in6); 830 snmp_mib_free((void **)udplite_stats_in6);
836} 831}
837 832
838static int __net_init ipv6_init_mibs(struct net *net) 833static int __net_init ipv6_init_mibs(struct net *net)
839{ 834{
835 if (snmp_mib_init((void **)net->mib.udp_stats_in6,
836 sizeof (struct udp_mib)) < 0)
837 return -ENOMEM;
840 return 0; 838 return 0;
841} 839}
842 840
843static void __net_exit ipv6_cleanup_mibs(struct net *net) 841static void __net_exit ipv6_cleanup_mibs(struct net *net)
844{ 842{
843 snmp_mib_free((void **)net->mib.udp_stats_in6);
845} 844}
846 845
847static int inet6_net_init(struct net *net) 846static int inet6_net_init(struct net *net)