mirror of
https://github.com/apache/nuttx.git
synced 2026-08-01 20:28:58 +00:00
net/udp: fix conn_unlock not called outside conditional block
Move conn_unlock() call outside the if block in psock_udp_sendto() to ensure the connection lock is always released before returning, preventing a potential deadlock when the condition is not met. Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
parent
54ee939f82
commit
faa4d7ff8d
1 changed files with 2 additions and 2 deletions
|
|
@ -895,10 +895,10 @@ ssize_t psock_udp_sendto(FAR struct socket *psock, FAR const void *buf,
|
|||
conn_unlock(&conn->sconn);
|
||||
goto errout_with_wrb;
|
||||
}
|
||||
|
||||
conn_unlock(&conn->sconn);
|
||||
}
|
||||
|
||||
conn_unlock(&conn->sconn);
|
||||
|
||||
/* Return the number of bytes that will be sent */
|
||||
|
||||
return len;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue