diff options
author | Colin Cross <ccross@android.com> | 2009-10-23 12:06:42 -0700 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2009-10-23 12:21:01 -0700 |
commit | 35f3f7d1fcee9a695407165de9cfc88da06244e0 (patch) | |
tree | 53de2169737b8683c6e7b60c2df46c18eecd25d9 /net | |
parent | 3b775374f2de86246e3c585560bf7b1e4006460d (diff) |
ipv4: Move sk_error_report inside bh_lock_sock in tcp_v4_nuke_addr
When sk_error_report is called, it wakes up the user-space thread, which then
calls tcp_close. When the tcp_close is interrupted by the tcp_v4_nuke_addr
ioctl thread running tcp_done, it leaks 392 bytes and triggers a WARN_ON.
This patch moves the call to sk_error_report inside the bh_lock_sock, which
matches the locking used in tcp_v4_err.
Signed-off-by: Colin Cross <ccross@android.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 87696dcdeba7..9fd72213c9d1 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c @@ -1877,14 +1877,14 @@ restart: if (sock_flag(sk, SOCK_DEAD)) continue; - sk->sk_err = ETIMEDOUT; - sk->sk_error_report(sk); - sock_hold(sk); spin_unlock_bh(lock); local_bh_disable(); bh_lock_sock(sk); + sk->sk_err = ETIMEDOUT; + sk->sk_error_report(sk); + tcp_done(sk); bh_unlock_sock(sk); local_bh_enable(); |