Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions features/netsocket/emac-drivers/TARGET_STM/stm32xx_emac.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ bool STM32_EMAC::link_out(emac_mem_buf_t *buf)
int STM32_EMAC::low_level_input(emac_mem_buf_t **buf)
#ifndef ETH_IP_VERSION_V2
{
uint16_t len = 0;
uint32_t len = 0;
uint8_t *buffer;
__IO ETH_DMADescTypeDef *dmarxdesc;
uint32_t bufferoffset = 0;
Expand All @@ -546,7 +546,7 @@ int STM32_EMAC::low_level_input(emac_mem_buf_t **buf)

dmarxdesc = EthHandle.RxFrameInfos.FSRxDesc;

if (len > 0) {
if (len > 0 && len <= ETH_RX_BUF_SIZE) {
/* Allocate a memory buffer chain from buffer pool */
*buf = memory_manager->alloc_pool(len, 0);
}
Expand Down