From: Wolfgang Denk Date: Sun, 25 Oct 2009 20:42:11 +0100 Subject: [U-Boot] [u-boot] [PATCH] [2/2] [v1.2] mxc_fec: avoid free() calls to already freed pointers. In-Reply-To: References: Message-ID: <20091025194211.926464C028@gemini.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 Dear Ben Warren, In message you wrote: > > > IMHO we should aim to make this driver less complicated, not more. Do we > really need to malloc and free each time this interface is turned on or off? > Why not just initialize the pointers to NULL, and malloc() only the first > time the init() function is called? You could then get rid of the free() > calls in the halt function. > > U-boot is very transient in nature. Once we launch a kernel all the memory > essentially gets freed anyway. Full ACK from me. And we don't use that many different Ethernet drivers in parallel either that the RAM footprint would hurt. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Genitiv ins Wasser, weil's Dativ ist!