From: Wolfgang Denk Date: Mon, 18 Jan 2010 00:31:44 +0100 Subject: [U-Boot] Issue in drivers/mmc/mmc.c In-Reply-To: <1262480450.2820.140.camel@samson.armitage.org.uk> References: <1262480450.2820.140.camel@samson.armitage.org.uk> Message-ID: <20100117233144.67FF3C88AE@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 Quentin Armitage, In message <1262480450.2820.140.camel@samson.armitage.org.uk> you wrote: > There appears to be a path through mmc_read in drivers/mmc/mmc.c where > malloc'd memory is not freed before exiting mmc_read, although this may > be a hypothetical situation. It occurs if mmc_set_blocklen() returns a > non-zero value. > > The following patch appears to resolve the issue: > > --- o/drivers/mmc/mmc.c 2010-01-03 00:44:41.000000000 +0000 > +++ drivers/mmc/mmc.c 2010-01-03 00:46:14.000000000 +0000 > @@ -172,7 +172,7 @@ int mmc_read(struct mmc *mmc, u64 src, u > err = mmc_set_blocklen(mmc, mmc->read_bl_len); > > if (err) > - return err; > + goto free_buffer; > > for (i = startblock; i <= endblock; i++) { > int segment_size; Can you please resent this patch, with your Signed-off-by: line added? See http://www.denx.de/wiki/U-Boot/Patches for details. Thanks. 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 "The more data I punch in this card, the lighter it becomes, and the lower the mailing cost." - Stan Kelly-Bootle, "The Devil's DP Dictionary"