From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Warren Date: Mon, 09 Nov 2009 22:53:41 -0800 Subject: [U-Boot] [u-boot] [PATCH] [2/2] [v1.4] mxc_fec: avoid free() calls to already freed pointers. In-Reply-To: References: Message-ID: <4AF90DF5.30303@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de javier Martin wrote: > Sometimes, inside NetLoop, eth_halt() is called before eth_init() has > been called. This is harmless except for free() calls to pointers > which have not been allocated yet. > > This patch initializes those pointers to NULL and allocates them only > the first time. This way we can get rid of free calls in halt callback. > > This has been tested in i.MX27 Litekit board and eldk-4.2 toolchains. > > Signed-off-by: Javier Martin > -- > drivers/net/fec_mxc.c | 12 +++++++----- > 1 files changed, 7 insertions(+), 5 deletions(-) > Applied to net repo. thanks, Ben