Skip to content

Commit

Permalink
Phonet: do not set POLLOUT in case of send buffer overflow
Browse files Browse the repository at this point in the history
Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Rémi Denis-Courmont authored and David S. Miller committed Aug 31, 2010
1 parent 02ac326 commit 01b3860
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/phonet/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 01b3860

Please sign in to comment.