diff --git a/arch/xtensa/src/esp32s3/esp32s3_wlan.c b/arch/xtensa/src/esp32s3/esp32s3_wlan.c index 9a27d1dda94..70f0b7f9dc8 100644 --- a/arch/xtensa/src/esp32s3/esp32s3_wlan.c +++ b/arch/xtensa/src/esp32s3/esp32s3_wlan.c @@ -448,29 +448,23 @@ static int wlan_rx_done(struct wlan_priv_s *priv, void *buffer, goto out; } +out: + if (eb != NULL) { esp_wifi_free_eb(eb); } + if (ret != OK && iob != NULL) + { + iob_free_chain(iob); + } + if (work_available(&priv->rxwork)) { work_queue(WLAN_WORK, &priv->rxwork, wlan_rxpoll, priv, 0); } - return 0; - -out: - if (iob != NULL) - { - iob_free_chain(iob); - } - - if (eb != NULL) - { - esp_wifi_free_eb(eb); - } - wlan_txavail(&priv->dev); return ret;