Skip to content

Commit

Permalink
Merge pull request #12776 from JarkkoPaso/update_stm32_emac_ethernet_…
Browse files Browse the repository at this point in the history
…driver

Update stm32 emac ethernet driver
  • Loading branch information
0xc0170 authored Apr 8, 2020
2 parents 64b10f4 + 38f9a09 commit 757f14b
Showing 1 changed file with 2 additions and 2 deletions.
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

0 comments on commit 757f14b

Please sign in to comment.