diff options
author | Rémi Denis-Courmont <remi.denis-courmont@nokia.com> | 2010-08-30 12:57:05 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-08-31 13:04:33 -0700 |
commit | 01b38606bded44bf8b7ca42e8fe5f2cad5d28121 (patch) | |
tree | 556fd914f9e13df3627ae19df1ccc87a7691cafe /net/phonet | |
parent | 02ac3268a581639af241c254579160909373e12c (diff) | |
download | op-kernel-dev-01b38606bded44bf8b7ca42e8fe5f2cad5d28121.zip op-kernel-dev-01b38606bded44bf8b7ca42e8fe5f2cad5d28121.tar.gz |
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>
Diffstat (limited to 'net/phonet')
-rw-r--r-- | net/phonet/socket.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/phonet/socket.c b/net/phonet/socket.c index 6e9848bf..7c91f73 100644 --- a/net/phonet/socket.c +++ b/net/phonet/socket.c @@ -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; |