From 75626fb07117e35ec9cd326fb51aa664f524e96c Mon Sep 17 00:00:00 2001 From: SaeHie Park Date: Wed, 29 Jul 2015 14:51:30 +0900 Subject: [PATCH] STM32: Fix eth mem leak in recvframe --- arch/arm/src/stm32/stm32_eth.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/arm/src/stm32/stm32_eth.c b/arch/arm/src/stm32/stm32_eth.c index 4b65f7129e..4d77154521 100644 --- a/arch/arm/src/stm32/stm32_eth.c +++ b/arch/arm/src/stm32/stm32_eth.c @@ -1670,6 +1670,16 @@ static void stm32_receive(FAR struct stm32_ethmac_s *priv) if (dev->d_len > CONFIG_NET_ETH_MTU) { nlldbg("DROPPED: Too big: %d\n", dev->d_len); + + /* free dropped packet buffer */ + if (dev->d_buf) + { + nllvdbg("! dev->d_buf not NULL, %p / %d\n", + dev->d_buf, dev->d_len ); + stm32_freebuffer(priv, dev->d_buf); + dev->d_buf = NULL; + dev->d_len = 0; + } continue; }