diff --git a/net/tcp/tcp_netpoll.c b/net/tcp/tcp_netpoll.c index 796c0a8b0eb53..f4eabc45d9ef6 100644 --- a/net/tcp/tcp_netpoll.c +++ b/net/tcp/tcp_netpoll.c @@ -344,6 +344,7 @@ int tcp_pollsetup(FAR struct socket *psock, FAR struct pollfd *fds) * exceptional event. */ + _SO_CONN_SETERRNO(conn, ENOTCONN); eventset |= POLLERR | POLLHUP; } else if (_SS_ISCONNECTED(conn->sconn.s_flags) &&