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 2021/07/01 12:56:21 UTC

[GitHub] [incubator-nuttx] GUIDINGLI commented on a change in pull request #4014: net/tcp: fix tcp crash when net meet popen syscall

GUIDINGLI commented on a change in pull request #4014:
URL: https://github.com/apache/incubator-nuttx/pull/4014#discussion_r662264165



##########
File path: net/tcp/tcp_monitor.c
##########
@@ -346,15 +346,13 @@ void tcp_close_monitor(FAR struct socket *psock)
   /* Find and free the the connection event callback */
 
   net_lock();
-  for (cb = conn->connevents;
-       cb != NULL && cb->priv != (FAR void *)psock;
-       cb = cb->nxtconn)
-    {
-    }
 
-  if (cb != NULL)
+  for (cb = conn->connevents; cb != NULL; cb = cb->nxtconn)
     {
-      devif_conn_callback_free(conn->dev, cb, &conn->connevents);
+      if (cb->priv == (FAR void *)psock)
+        {
+          devif_conn_callback_free(conn->dev, cb, &conn->connevents);

Review comment:
       see the Summary




-- 
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