aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/af_inet.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/af_inet.c')
-rw-r--r--net/ipv4/af_inet.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index bf1f200c6575..5c72bb3adadd 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -1355,10 +1355,15 @@ static __net_init int ipv4_mib_init_net(struct net *net)
1355 if (snmp_mib_init((void **)net->mib.udplite_statistics, 1355 if (snmp_mib_init((void **)net->mib.udplite_statistics,
1356 sizeof(struct udp_mib)) < 0) 1356 sizeof(struct udp_mib)) < 0)
1357 goto err_udplite_mib; 1357 goto err_udplite_mib;
1358 if (snmp_mib_init((void **)net->mib.icmp_statistics,
1359 sizeof(struct icmp_mib)) < 0)
1360 goto err_icmp_mib;
1358 1361
1359 tcp_mib_init(net); 1362 tcp_mib_init(net);
1360 return 0; 1363 return 0;
1361 1364
1365err_icmp_mib:
1366 snmp_mib_free((void **)net->mib.udplite_statistics);
1362err_udplite_mib: 1367err_udplite_mib:
1363 snmp_mib_free((void **)net->mib.udp_statistics); 1368 snmp_mib_free((void **)net->mib.udp_statistics);
1364err_udp_mib: 1369err_udp_mib:
@@ -1373,6 +1378,7 @@ err_tcp_mib:
1373 1378
1374static __net_exit void ipv4_mib_exit_net(struct net *net) 1379static __net_exit void ipv4_mib_exit_net(struct net *net)
1375{ 1380{
1381 snmp_mib_free((void **)net->mib.icmp_statistics);
1376 snmp_mib_free((void **)net->mib.udplite_statistics); 1382 snmp_mib_free((void **)net->mib.udplite_statistics);
1377 snmp_mib_free((void **)net->mib.udp_statistics); 1383 snmp_mib_free((void **)net->mib.udp_statistics);
1378 snmp_mib_free((void **)net->mib.net_statistics); 1384 snmp_mib_free((void **)net->mib.net_statistics);
@@ -1387,9 +1393,6 @@ static __net_initdata struct pernet_operations ipv4_mib_ops = {
1387 1393
1388static int __init init_ipv4_mibs(void) 1394static int __init init_ipv4_mibs(void)
1389{ 1395{
1390 if (snmp_mib_init((void **)icmp_statistics,
1391 sizeof(struct icmp_mib)) < 0)
1392 goto err_icmp_mib;
1393 if (snmp_mib_init((void **)icmpmsg_statistics, 1396 if (snmp_mib_init((void **)icmpmsg_statistics,
1394 sizeof(struct icmpmsg_mib)) < 0) 1397 sizeof(struct icmpmsg_mib)) < 0)
1395 goto err_icmpmsg_mib; 1398 goto err_icmpmsg_mib;
@@ -1402,8 +1405,6 @@ static int __init init_ipv4_mibs(void)
1402err_net: 1405err_net:
1403 snmp_mib_free((void **)icmpmsg_statistics); 1406 snmp_mib_free((void **)icmpmsg_statistics);
1404err_icmpmsg_mib: 1407err_icmpmsg_mib:
1405 snmp_mib_free((void **)icmp_statistics);
1406err_icmp_mib:
1407 return -ENOMEM; 1408 return -ENOMEM;
1408} 1409}
1409 1410