Skip to content

Commit 757f14b

Browse files
authored
Merge pull request #12776 from JarkkoPaso/update_stm32_emac_ethernet_driver
Update stm32 emac ethernet driver
2 parents 64b10f4 + 38f9a09 commit 757f14b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

features/netsocket/emac-drivers/TARGET_STM/stm32xx_emac.cpp

100644100755
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ bool STM32_EMAC::link_out(emac_mem_buf_t *buf)
526526
int STM32_EMAC::low_level_input(emac_mem_buf_t **buf)
527527
#ifndef ETH_IP_VERSION_V2
528528
{
529-
uint16_t len = 0;
529+
uint32_t len = 0;
530530
uint8_t *buffer;
531531
__IO ETH_DMADescTypeDef *dmarxdesc;
532532
uint32_t bufferoffset = 0;
@@ -546,7 +546,7 @@ int STM32_EMAC::low_level_input(emac_mem_buf_t **buf)
546546

547547
dmarxdesc = EthHandle.RxFrameInfos.FSRxDesc;
548548

549-
if (len > 0) {
549+
if (len > 0 && len <= ETH_RX_BUF_SIZE) {
550550
/* Allocate a memory buffer chain from buffer pool */
551551
*buf = memory_manager->alloc_pool(len, 0);
552552
}

0 commit comments

Comments
 (0)