We can't hold the lock while calling to tcp_done(), so we drop
it before calling. We then have to start at the top of the chain again.
Signed-off-by: Dima Zavin <dima@android.com>
struct sock *sk;
spinlock_t *lock = inet_ehash_lockp(&tcp_hashinfo, bucket);
+restart:
spin_lock_bh(lock);
sk_nulls_for_each(sk, node, &tcp_hashinfo.ehash[bucket].chain) {
struct inet_sock *inet = inet_sk(sk);
sk->sk_err = ETIMEDOUT;
sk->sk_error_report(sk);
+ spin_unlock_bh(lock);
tcp_done(sk);
+ goto restart;
}
spin_unlock_bh(lock);
}