net/nat: Unlock on outbound NAT entry creation failure.

Release nat_lock before returning -ENOENT from the IPv4 and IPv6
outbound NAT paths when NAT entry creation fails.

Signed-off-by: Shunchao Hu <ankohuu@gmail.com>
This commit is contained in:
Shunchao Hu
2026-04-04 08:48:25 +08:00
committed by Matteo Golin
parent 78e3f17b9e
commit 1e6c751db7
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -795,6 +795,7 @@ int ipv4_nat_outbound(FAR struct net_driver_s *dev,
{
/* Outbound entry creation failed, should have entry. */
nat_unlock();
return -ENOENT;
}
}
+1
View File
@@ -683,6 +683,7 @@ int ipv6_nat_outbound(FAR struct net_driver_s *dev,
{
/* Outbound entry creation failed, should have entry. */
nat_unlock();
return -ENOENT;
}
}