diff --git a/drivers/net/netdev_upperhalf.c b/drivers/net/netdev_upperhalf.c index 3c9e0438f8e..185e160d98e 100644 --- a/drivers/net/netdev_upperhalf.c +++ b/drivers/net/netdev_upperhalf.c @@ -483,6 +483,7 @@ netdev_upper_vlan_foreach(FAR struct netdev_upperhalf_s *upper, { int i; + net_lock(); for (i = 0; i < CONFIG_NET_VLAN_COUNT; i++) { if (upper->vlan[i].dev) @@ -490,6 +491,8 @@ netdev_upper_vlan_foreach(FAR struct netdev_upperhalf_s *upper, cb(upper->vlan[i].dev); } } + + net_unlock(); } #endif