aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/icmp.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/icmp.c')
-rw-r--r--net/ipv4/icmp.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index 7c62a0da5264..97d97ada4ce6 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -1146,14 +1146,8 @@ static void __exit icmp_exit(void)
1146{ 1146{
1147 int i; 1147 int i;
1148 1148
1149 for_each_possible_cpu(i) { 1149 for_each_possible_cpu(i)
1150 struct sock *sk; 1150 sk_release_kernel(__icmp_sk[i]);
1151
1152 sk = __icmp_sk[i];
1153 if (sk == NULL)
1154 continue;
1155 sock_release(sk->sk_socket);
1156 }
1157 kfree(__icmp_sk); 1151 kfree(__icmp_sk);
1158 __icmp_sk = NULL; 1152 __icmp_sk = NULL;
1159} 1153}
@@ -1176,6 +1170,8 @@ int __init icmp_init(void)
1176 goto fail; 1170 goto fail;
1177 1171
1178 __icmp_sk[i] = sk = sock->sk; 1172 __icmp_sk[i] = sk = sock->sk;
1173 sk_change_net(sk, &init_net);
1174
1179 sk->sk_allocation = GFP_ATOMIC; 1175 sk->sk_allocation = GFP_ATOMIC;
1180 1176
1181 /* Enough space for 2 64K ICMP packets, including 1177 /* Enough space for 2 64K ICMP packets, including