mirror of
https://github.com/apache/nuttx.git
synced 2026-05-24 16:11:56 +08:00
net/netdev: separate netdev_list_lock from net_lock
use netdev_list_lock to protect all network card traversal, registration, and deregistration operations. Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
@@ -63,7 +63,7 @@ FAR struct net_driver_s *netdev_default(void)
|
||||
|
||||
/* Examine each registered network device */
|
||||
|
||||
net_lock();
|
||||
netdev_list_lock();
|
||||
for (dev = g_netdevices; dev; dev = dev->flink)
|
||||
{
|
||||
/* Is the interface in the "up" state? */
|
||||
@@ -84,6 +84,6 @@ FAR struct net_driver_s *netdev_default(void)
|
||||
}
|
||||
}
|
||||
|
||||
net_unlock();
|
||||
netdev_list_unlock();
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user