You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/07/09 08:32:11 UTC

[GitHub] [incubator-nuttx] anchao commented on a diff in pull request #6590: net/poll: fix race condition if connect free before poll teardown

anchao commented on code in PR #6590:
URL: https://github.com/apache/incubator-nuttx/pull/6590#discussion_r917239342


##########
net/icmp/icmp_netpoll.c:
##########
@@ -142,17 +142,27 @@ static uint16_t icmp_poll_eventhandler(FAR struct net_driver_s *dev,
 
 int icmp_pollsetup(FAR struct socket *psock, FAR struct pollfd *fds)
 {
-  FAR struct icmp_conn_s *conn = psock->s_conn;
+  FAR struct icmp_conn_s *conn;
   FAR struct icmp_poll_s *info;
   FAR struct devif_callback_s *cb;
   int ret = OK;
 
-  DEBUGASSERT(conn != NULL && fds != NULL);
-
   /* Some of the  following must be atomic */
 
   net_lock();
 
+  conn = psock->s_conn;
+
+  /* Sanity check */
+
+#ifdef CONFIG_DEBUG_FEATURES

Review Comment:
   Done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org