This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 7662ce6d5114e7a447b080e1ae7e526d42656725
Author: zhanghongyu <[email protected]>
AuthorDate: Tue Sep 23 10:36:07 2025 +0800

    net_sockif.c: add rmutex init to SOCK_CTRL
    
    fix the issue where acquiring the lock gets stuck due to the sconn lock
    not being initialized.
    
    Signed-off-by: zhanghongyu <[email protected]>
---
 net/socket/net_sockif.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/net/socket/net_sockif.c b/net/socket/net_sockif.c
index cb7c74ce29a..cb4d62493cb 100644
--- a/net/socket/net_sockif.c
+++ b/net/socket/net_sockif.c
@@ -71,7 +71,10 @@ static const struct sock_intf_s g_ctrl_sockif =
   ctrl_close        /* si_close */
 };
 
-static struct socket_conn_s g_ctrl_conn;
+static struct socket_conn_s g_ctrl_conn =
+{
+  .s_lock = NXRMUTEX_INITIALIZER,
+};
 
 /****************************************************************************
  * Private Functions

Reply via email to