Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 01b38606 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont Committed by David S. Miller
Browse files

Phonet: do not set POLLOUT in case of send buffer overflow

parent 02ac3268
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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;