drivers: uart: stm32 async uart driver should free next buffer
When disabling async rx, the next buffer is not free-ed by the stm32 uart driver. Signed-off-by: Wouter Cappelle <wouter.cappelle@crodeon.com>
This commit is contained in:
parent
cf701acb94
commit
984b612c48
1 changed files with 8 additions and 0 deletions
|
@ -1129,6 +1129,14 @@ static int uart_stm32_async_rx_disable(const struct device *dev)
|
|||
|
||||
dma_stop(data->dma_rx.dma_dev, data->dma_rx.dma_channel);
|
||||
|
||||
if (data->rx_next_buffer) {
|
||||
struct uart_event rx_next_buf_release_evt = {
|
||||
.type = UART_RX_BUF_RELEASED,
|
||||
.data.rx_buf.buf = data->rx_next_buffer,
|
||||
};
|
||||
async_user_callback(data, &rx_next_buf_release_evt);
|
||||
}
|
||||
|
||||
data->rx_next_buffer = NULL;
|
||||
data->rx_next_buffer_len = 0;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue