Skip to content

Commit 1a70814

Browse files
committed
Fix: Free buffer of error case in SDIO streaming mode
1 parent 534c20f commit 1a70814

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

host/drivers/transport/sdio/sdio_drv.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,8 @@ static esp_err_t sdio_push_data_to_queue(uint8_t * buf, uint32_t buf_len)
706706

707707
packet_size = len + offset;
708708
if (packet_size > buf_len) {
709-
ESP_LOGE(TAG, "packet size too big for remaining stream data");
709+
ESP_LOGE(TAG, "packet size[%lu]>[%lu] too big for remaining stream data",
710+
packet_size, buf_len);
710711
return ESP_FAIL;
711712
}
712713
memcpy(pkt_rxbuff, buf, packet_size);
@@ -770,7 +771,7 @@ static void sdio_read_task(void const* pvParameters)
770771

771772
// wait for transport to be in reset state
772773
while (true) {
773-
vTaskDelay(pdMS_TO_TICKS(100));
774+
g_h.funcs->_h_msleep(100);
774775
if (is_transport_rx_ready()) {
775776
break;
776777
}
@@ -929,6 +930,7 @@ static void sdio_read_task(void const* pvParameters)
929930
g_h.funcs->_h_post_semaphore(sem_double_buf_xfer_data);
930931
} else {
931932
// error: task to copy data to queue still running
933+
sdio_rx_free_buffer(rxbuff);
932934
ESP_LOGE(TAG, "task still writing Rx data to queue!");
933935
// don't send data to task, or update write_index
934936
}

0 commit comments

Comments
 (0)