Skip to content

Commit 8b3918c

Browse files
committed
Merge branch 'bugfix/sdio_streaming' into 'feature/esp_as_mcu_host'
bugfix/sdio_streaming Fixed sdio read len check See merge request app-frameworks/esp_hosted!494
2 parents 71f942b + 2e7efde commit 8b3918c

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

host/drivers/transport/sdio/sdio_drv.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -203,14 +203,16 @@ static int sdio_get_len_from_slave(uint32_t *rx_size, bool is_lock_needed)
203203
/* Handle a case of roll over */
204204
temp = ESP_RX_BYTE_MAX - sdio_rx_byte_count;
205205
len = temp + len;
206+
}
206207

207208
#if H_SDIO_HOST_RX_MODE != H_SDIO_HOST_STREAMING_MODE
208-
if (len > ESP_RX_BUFFER_SIZE) {
209-
ESP_LOGI(TAG, "%s: Len from slave[%ld] exceeds max [%d]",
210-
__func__, len, ESP_RX_BUFFER_SIZE);
211-
}
212-
#endif
209+
if (len > ESP_RX_BUFFER_SIZE) {
210+
ESP_LOGE(TAG, "%s: Len from slave[%ld] exceeds max [%d]",
211+
__func__, len, ESP_RX_BUFFER_SIZE);
212+
return ESP_FAIL;
213213
}
214+
#endif
215+
214216
*rx_size = len;
215217

216218
return 0;

0 commit comments

Comments
 (0)