From ddef306394fa48fe0f01aa213767d69da7971ac0 Mon Sep 17 00:00:00 2001 From: Thibo Verheyde Date: Wed, 8 May 2024 09:35:08 +0200 Subject: [PATCH] drivers: serial: esp32: Fix next buffer release on rx disable Set event data rx buffer as next buffer instead of current buffer. Signed-off-by: Thibo Verheyde --- drivers/serial/uart_esp32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/serial/uart_esp32.c b/drivers/serial/uart_esp32.c index 48f213c7394..0bbc3fb4d2d 100644 --- a/drivers/serial/uart_esp32.c +++ b/drivers/serial/uart_esp32.c @@ -888,7 +888,7 @@ static int uart_esp32_async_rx_disable(const struct device *dev) /*Release next buffer*/ if (data->async.rx_next_len) { evt.type = UART_RX_BUF_RELEASED; - evt.data.rx_buf.buf = data->async.rx_buf; + evt.data.rx_buf.buf = data->async.rx_next_buf; if (data->async.cb) { data->async.cb(dev, &evt, data->async.user_data); }