diff mbox series

[net-next,2/2] net: tap: fix POLLOUT condition in tap_poll()

Message ID 1512998866-17966-1-git-send-email-cugyly@163.com
State Changes Requested, archived
Delegated to: David Miller
Headers show
Series net: tap: two minor issue | expand

Commit Message

yuan linyu Dec. 11, 2017, 1:27 p.m. UTC
From: yuan linyu <Linyu.Yuan@alcatel-sbell.com.cn>

from logical view, if sock_writeable(&q->sk) return false,
original second condition will false too,
change it and make second condition can return true.

Signed-off-by: yuan linyu <Linyu.Yuan@alcatel-sbell.com.cn>
---
 drivers/net/tap.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/tap.c b/drivers/net/tap.c
index 78900a0..b809405 100644
--- a/drivers/net/tap.c
+++ b/drivers/net/tap.c
@@ -583,8 +583,7 @@  static unsigned int tap_poll(struct file *file, poll_table *wait)
 		mask |= POLLIN | POLLRDNORM;
 
 	if (sock_writeable(&q->sk) ||
-	    (!test_and_set_bit(SOCKWQ_ASYNC_NOSPACE, &q->sock.flags) &&
-	     sock_writeable(&q->sk)))
+	    !test_and_set_bit(SOCKWQ_ASYNC_NOSPACE, &q->sock.flags))
 		mask |= POLLOUT | POLLWRNORM;
 
 out: