From af9c67ab58c12615524be0690c983299e08c7d95 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Mon, 25 Nov 2019 09:32:24 -0600 Subject: [PATCH] net/tcp/tcp_netpoll.c and net/udp/udp_netpoll.c: In [tcp|udp]_iob_work fix the wrong condition logic (& vs &&). --- net/tcp/tcp_netpoll.c | 4 ++-- net/udp/udp_netpoll.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/net/tcp/tcp_netpoll.c b/net/tcp/tcp_netpoll.c index 5a044d70166..f2c6f3b1bad 100644 --- a/net/tcp/tcp_netpoll.c +++ b/net/tcp/tcp_netpoll.c @@ -212,8 +212,8 @@ static inline void tcp_iob_work(FAR void *arg) * event. If so, don't do it again and don't setup notification again. */ - else if ((fds->events && POLLWRNORM) == 0 || - (fds->revents && POLLWRNORM) != 0) + else if ((fds->events & POLLWRNORM) != 0 && + (fds->revents & POLLWRNORM) == 0) { /* Check if we are now able to send */ diff --git a/net/udp/udp_netpoll.c b/net/udp/udp_netpoll.c index 4ac2a563f8c..9c2ae9a134f 100644 --- a/net/udp/udp_netpoll.c +++ b/net/udp/udp_netpoll.c @@ -185,8 +185,8 @@ static inline void udp_iob_work(FAR void *arg) * event. If so, don't do it again. */ - if ((fds->events && POLLWRNORM) == 0 || - (fds->revents && POLLWRNORM) != 0) + if ((fds->events & POLLWRNORM) != 0 && + (fds->revents & POLLWRNORM) == 0) { /* Check if we are now able to send */