Skip to content

Commit

Permalink
Merge branch 'bugfix/sdio_streaming' into 'feature/esp_as_mcu_host'
Browse files Browse the repository at this point in the history
bugfix/sdio_streaming Fixed sdio read len check

See merge request app-frameworks/esp_hosted!494
  • Loading branch information
mantriyogesh committed Sep 3, 2024
2 parents 71f942b + 2e7efde commit 8b3918c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions host/drivers/transport/sdio/sdio_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,14 +203,16 @@ static int sdio_get_len_from_slave(uint32_t *rx_size, bool is_lock_needed)
/* Handle a case of roll over */
temp = ESP_RX_BYTE_MAX - sdio_rx_byte_count;
len = temp + len;
}

#if H_SDIO_HOST_RX_MODE != H_SDIO_HOST_STREAMING_MODE
if (len > ESP_RX_BUFFER_SIZE) {
ESP_LOGI(TAG, "%s: Len from slave[%ld] exceeds max [%d]",
__func__, len, ESP_RX_BUFFER_SIZE);
}
#endif
if (len > ESP_RX_BUFFER_SIZE) {
ESP_LOGE(TAG, "%s: Len from slave[%ld] exceeds max [%d]",
__func__, len, ESP_RX_BUFFER_SIZE);
return ESP_FAIL;
}
#endif

*rx_size = len;

return 0;
Expand Down

0 comments on commit 8b3918c

Please sign in to comment.