From: Wolfgang Denk Date: Tue, 20 Oct 2009 12:41:50 +0200 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: <20091020104151.067BC182FC42D@nyx.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 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() and when it is not. > > This has been tested in i.MX27 Litekit board and eldk-4.2 toolchains. Thanks. > /** > + * @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 around, i. e. please use FEC_STATUS_INIT and FEC_STATUS_HALT. Also, we might consider using an enum here? 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 Dear Lord: I just want *one* one-armed manager so I never have to hear "On the other hand", again.