net/udp: fix net_[un]lock() in udp_bind
net_unlock() called without a previous call to net_lock().
Error introduced by b10d6be17a
This commit is contained in:
parent
80da796897
commit
324446bbba
1 changed files with 5 additions and 6 deletions
|
@ -816,6 +816,10 @@ int udp_bind(FAR struct udp_conn_s *conn, FAR const struct sockaddr *addr)
|
|||
}
|
||||
#endif
|
||||
|
||||
/* Interrupts must be disabled while access the UDP connection list */
|
||||
|
||||
net_lock();
|
||||
|
||||
#ifdef CONFIG_NET_IPv4
|
||||
#ifdef CONFIG_NET_IPv6
|
||||
if (conn->domain == PF_INET)
|
||||
|
@ -928,10 +932,6 @@ int udp_bind(FAR struct udp_conn_s *conn, FAR const struct sockaddr *addr)
|
|||
}
|
||||
else
|
||||
{
|
||||
/* Interrupts must be disabled while access the UDP connection list */
|
||||
|
||||
net_lock();
|
||||
|
||||
/* Is any other UDP connection already bound to this address
|
||||
* and port ?
|
||||
*/
|
||||
|
@ -958,10 +958,9 @@ int udp_bind(FAR struct udp_conn_s *conn, FAR const struct sockaddr *addr)
|
|||
{
|
||||
ret = -EADDRINUSE;
|
||||
}
|
||||
|
||||
net_unlock();
|
||||
}
|
||||
|
||||
net_unlock();
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue