Re: [U-Boot] [u-boot] [PATCH] [2/2] [v1.2] mxc_fec: avoid free() calls to already freed pointers.

2009-10-25 Thread Wolfgang Denk
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() fu

Re: [U-Boot] [u-boot] [PATCH] [2/2] [v1.2] mxc_fec: avoid free() calls to already freed pointers.

2009-10-25 Thread Ben Warren
Javier, On Mon, Oct 19, 2009 at 10:48 PM, javier Martin < javier.mar...@vista-silicon.com> 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 adds two s

Re: [U-Boot] [u-boot] [PATCH] [2/2] [v1.2] mxc_fec: avoid free() calls to already freed pointers.

2009-10-20 Thread javier Martin
> >>  /** >> + * @brief Possible values for status >> + * >> + * fec_halt() changes the status to FEC_HALT_STATUS and fec_init() >> + * changes the status to FEC_INIT_STATUS >> + */ >> +#define FEC_HALT_STATUS 0 >> +#define FEC_INIT_STATUS 1 > > It would seem more logical to me if you swapped names

Re: [U-Boot] [u-boot] [PATCH] [2/2] [v1.2] mxc_fec: avoid free() calls to already freed pointers.

2009-10-20 Thread Wolfgang Denk
Dear javier Martin, In message you 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 adds two states to > distinguish when it is necessary to call free

[U-Boot] [u-boot] [PATCH] [2/2] [v1.2] mxc_fec: avoid free() calls to already freed pointers.

2009-10-19 Thread javier Martin
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 adds two states to distinguish when it is necessary to call free() and when it is not. This has been tested in i.MX2