From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wolfgang Denk Date: Fri, 07 Jan 2011 18:50:55 +0100 Subject: [U-Boot] [PATCH v2 2/9] make the hwconfig buffer deeper In-Reply-To: <740DF509-6661-4611-BE1B-BBB629012697@kernel.crashing.org> References: <1292630381-23022-1-git-send-email-yorksun@freescale.com> <1292630381-23022-2-git-send-email-yorksun@freescale.com> <20101218222535.58FF31524E8@gemini.denx.de> <1294085287.24386.52.camel@oslab-l1> <20110103211125.710E5CEF7A6@gemini.denx.de> <1294089991.24386.58.camel@oslab-l1> <20110103214745.CCE33CEF94F@gemini.denx.de> <740DF509-6661-4611-BE1B-BBB629012697@kernel.crashing.org> Message-ID: <20110107175055.992F62FC@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 Kumar Gala, In message <740DF509-6661-4611-BE1B-BBB629012697@kernel.crashing.org> you wrote: > > >> Making a buffer in a function's stack and make use of it out of the > >> scope, that's the buggy code I am referring. > > > > That is bad indeed, and needs to be fixed. > > Where is that happening? __hwconfig() calls hwconfig_parse() an passes a local stack buffer (buf) as argument; hwconfig_parse() returns a pointer into this buffer; then __hwconfig() returns the return value from hwconfig_parse() - but here the local stack buffer gots out of scope. 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 Make it right before you make it faster.