From 75277a9419e88e3729ef10db788ab5ddf7a09794 Mon Sep 17 00:00:00 2001
From: Alexey Lapshin
Date: Mon, 17 Jun 2024 23:06:30 +0700
Subject: [PATCH] fix(esp_driver_parlio): fix warnings found by GNU static
analyzer
---
components/esp_driver_parlio/src/parlio_tx.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/components/esp_driver_parlio/src/parlio_tx.c b/components/esp_driver_parlio/src/parlio_tx.c
index 20a0fdc4bcae..3dfeb9f9d0f4 100644
--- a/components/esp_driver_parlio/src/parlio_tx.c
+++ b/components/esp_driver_parlio/src/parlio_tx.c
@@ -389,10 +389,12 @@ static void IRAM_ATTR parlio_tx_mount_dma_data(parlio_tx_unit_t *tx_unit, const
{
size_t prepared_length = 0;
uint8_t *data = (uint8_t *)buffer;
+ uint32_t mount_bytes = 0;
parlio_dma_desc_t *desc_nc = tx_unit->dma_nodes_nc;
while (len) {
- uint32_t mount_bytes = len > DMA_DESCRIPTOR_BUFFER_MAX_SIZE ? DMA_DESCRIPTOR_BUFFER_MAX_SIZE : len;
+ assert(desc_nc);
+ mount_bytes = len > DMA_DESCRIPTOR_BUFFER_MAX_SIZE ? DMA_DESCRIPTOR_BUFFER_MAX_SIZE : len;
len -= mount_bytes;
desc_nc->dw0.suc_eof = (len == 0); // whether the last frame
desc_nc->dw0.size = mount_bytes;