diff --git a/arch/risc-v/src/common/espressif/esp_wlan.c b/arch/risc-v/src/common/espressif/esp_wlan.c index 231cfab461..dc0d879a46 100644 --- a/arch/risc-v/src/common/espressif/esp_wlan.c +++ b/arch/risc-v/src/common/espressif/esp_wlan.c @@ -321,8 +321,11 @@ static inline void wlan_cache_txpkt_tail(struct wlan_priv_s *priv) static struct iob_s *wlan_recvframe(struct wlan_priv_s *priv) { struct iob_s *iob; + irqstate_t flags; + flags = spin_lock_irqsave(&priv->lock); iob = iob_remove_queue(&priv->rxb); + spin_unlock_irqrestore(&priv->lock, flags); return iob; }