mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 09:18:00 +08:00
net/tcp: fix tcp crash when net meet popen syscall
tcp_close_monitor should free all the connevents which belong to current psock Change-Id: Ifc625d7bc44a02930921d75975cb9b5835c2deeb Signed-off-by: ligd <liguiding1@xiaomi.com> (cherry picked from commit 7134b1df4aa91fe4f2575cd9c2322d36710865dc)
This commit is contained in:
@@ -361,15 +361,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);
|
||||
}
|
||||
}
|
||||
|
||||
/* Make sure that this socket is explicitly marked as closed */
|
||||
|
||||
Reference in New Issue
Block a user