nuttx/arch/xtensa/src
Felipe Moura 1c6ed642bf espressif: stop leaking a Wi-Fi interrupt handle on every esp_wifi_start()
set_intr_wrapper() allocates a new intr_handle_data_t from the kernel
heap each time the Wi-Fi driver calls it, and the driver calls it on
every esp_wifi_start() -- twice per start on esp32s3 -- not only the
first time.  clear_intr_wrapper() is a no-op, so the IRQ still holds the
handle from the previous start: esp_set_handle() refuses to replace it
with -EINVAL, the return value is ignored, and the new block is lost.

Any application that stops and restarts Wi-Fi to save power therefore
loses a few bytes of kernel heap per cycle, without bound.

Look up the vector descriptor first, then reuse the handle already
registered for the IRQ and only allocate and register one when there is
none.  A failed descriptor lookup no longer touches the registered
handle.

The same code is present in the esp32, esp32s2, esp32s3, esp32c3 and
esp32c6 Wi-Fi adapters; all five are fixed the same way.

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 13:25:42 -03:00
..
cmake cmake: Use NUTTX(_DIR/_BIN_DIR) instead CMAKE(_SRC_DIR/_BIN_DIR) 2026-08-09 11:13:08 -03:00
common arch/xtensa: Use one name for the stack frame alignment. 2026-09-29 11:13:47 -03:00
esp32 espressif: stop leaking a Wi-Fi interrupt handle on every esp_wifi_start() 2026-09-30 13:25:42 -03:00
esp32s2 espressif: stop leaking a Wi-Fi interrupt handle on every esp_wifi_start() 2026-09-30 13:25:42 -03:00
esp32s3 espressif: stop leaking a Wi-Fi interrupt handle on every esp_wifi_start() 2026-09-30 13:25:42 -03:00
lx6 arch, boards, cmake: Build C++ ELF modules without __cxa_atexit. 2026-09-04 15:44:24 -03:00
lx7 xtensa: Support BUILD_KERNEL. 2026-09-10 23:28:43 +08:00
.gitignore
CMakeLists.txt
Makefile xtensa: Support BUILD_KERNEL. 2026-09-10 23:28:43 +08:00