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

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

commit 6e061f0809b0ee40030175e9d8278522d8843640
Author: shichunma <[email protected]>
AuthorDate: Mon Mar 23 21:36:09 2026 +0800

    net/nat: fix missed nat_unlock
    
    If call nat_enable twice, there will be a miss "nat_unlock".
    
    Signed-off-by: Jerry Ma <[email protected]>
---
 net/nat/nat.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/nat/nat.c b/net/nat/nat.c
index 426a04cd848..d8cf542b667 100644
--- a/net/nat/nat.c
+++ b/net/nat/nat.c
@@ -118,6 +118,7 @@ int nat_enable(FAR struct net_driver_s *dev)
   if (IFF_IS_NAT(dev->d_flags))
     {
       nwarn("WARNING: NAT was already enabled for %s!\n", dev->d_ifname);
+      nat_unlock();
       return -EEXIST;
     }
 

Reply via email to