From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Roese Date: Sat, 15 Mar 2008 07:07:44 +0100 Subject: [U-Boot-Users] Possible memory leak in cpu/ppc4xx/4xx_enet.c In-Reply-To: <47DB37FD.9000705@verizon.net> References: <47DB37FD.9000705@verizon.net> Message-ID: <200803150707.44465.sr@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dave, On Saturday 15 March 2008, Dave Littell wrote: > I've seen an issue with my 1.3.1-based port of U-Boot where a relatively > large number of pings issued from the command line will ultimately fail > with the message: > > Cannot allocate private hw data for eth_device... > > I looked around this message and it seems that ppc_4xx_eth_initialize() > malloc()?s a EMAC_4XX_HW_PST structure and assigns it to dev->priv. > However, nothing ever frees this buffer so standing on a ping will > ultimately pull down all the available memory. Hmmm. IIRC ppc_4xx_eth_initialize() is only called once upon bootup for ethernet driver initialization. The function called each time before network action is ppc_4xx_eth_init(). > One fix might be to free( dev->priv ) at the end of ppc_4xx_eth_halt(). > I tried this today and noted no ill effects. So did it work for you? Best regards, Stefan ===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de =====================================================================