Phonet: do not set POLLOUT in case of send buffer overflow
Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
02ac3268a5
commit
01b38606bd
1 changed files with 3 additions and 1 deletions
|
@ -281,7 +281,9 @@ static unsigned int pn_socket_poll(struct file *file, struct socket *sock,
|
|||
if (!mask && sk->sk_state == TCP_CLOSE_WAIT)
|
||||
return POLLHUP;
|
||||
|
||||
if (sk->sk_state == TCP_ESTABLISHED && atomic_read(&pn->tx_credits))
|
||||
if (sk->sk_state == TCP_ESTABLISHED &&
|
||||
atomic_read(&sk->sk_wmem_alloc) < sk->sk_sndbuf &&
|
||||
atomic_read(&pn->tx_credits))
|
||||
mask |= POLLOUT | POLLWRNORM | POLLWRBAND;
|
||||
|
||||
return mask;
|
||||
|
|
Loading…
Reference in a new issue