aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/dccp/minisocks.c6
-rw-r--r--net/ipv4/tcp_minisocks.c6
2 files changed, 12 insertions, 0 deletions
diff --git a/net/dccp/minisocks.c b/net/dccp/minisocks.c
index abd07a443219..178bb9833311 100644
--- a/net/dccp/minisocks.c
+++ b/net/dccp/minisocks.c
@@ -57,10 +57,16 @@ void dccp_time_wait(struct sock *sk, int state, int timeo)
57 if (state == DCCP_TIME_WAIT) 57 if (state == DCCP_TIME_WAIT)
58 timeo = DCCP_TIMEWAIT_LEN; 58 timeo = DCCP_TIMEWAIT_LEN;
59 59
60 /* tw_timer is pinned, so we need to make sure BH are disabled
61 * in following section, otherwise timer handler could run before
62 * we complete the initialization.
63 */
64 local_bh_disable();
60 inet_twsk_schedule(tw, timeo); 65 inet_twsk_schedule(tw, timeo);
61 /* Linkage updates. */ 66 /* Linkage updates. */
62 __inet_twsk_hashdance(tw, sk, &dccp_hashinfo); 67 __inet_twsk_hashdance(tw, sk, &dccp_hashinfo);
63 inet_twsk_put(tw); 68 inet_twsk_put(tw);
69 local_bh_enable();
64 } else { 70 } else {
65 /* Sorry, if we're out of memory, just CLOSE this 71 /* Sorry, if we're out of memory, just CLOSE this
66 * socket up. We've got bigger problems than 72 * socket up. We've got bigger problems than
diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c
index e36eff0403f4..b079b619b60c 100644
--- a/net/ipv4/tcp_minisocks.c
+++ b/net/ipv4/tcp_minisocks.c
@@ -310,10 +310,16 @@ void tcp_time_wait(struct sock *sk, int state, int timeo)
310 if (state == TCP_TIME_WAIT) 310 if (state == TCP_TIME_WAIT)
311 timeo = TCP_TIMEWAIT_LEN; 311 timeo = TCP_TIMEWAIT_LEN;
312 312
313 /* tw_timer is pinned, so we need to make sure BH are disabled
314 * in following section, otherwise timer handler could run before
315 * we complete the initialization.
316 */
317 local_bh_disable();
313 inet_twsk_schedule(tw, timeo); 318 inet_twsk_schedule(tw, timeo);
314 /* Linkage updates. */ 319 /* Linkage updates. */
315 __inet_twsk_hashdance(tw, sk, &tcp_hashinfo); 320 __inet_twsk_hashdance(tw, sk, &tcp_hashinfo);
316 inet_twsk_put(tw); 321 inet_twsk_put(tw);
322 local_bh_enable();
317 } else { 323 } else {
318 /* Sorry, if we're out of memory, just CLOSE this 324 /* Sorry, if we're out of memory, just CLOSE this
319 * socket up. We've got bigger problems than 325 * socket up. We've got bigger problems than