[U-Boot] Issue in drivers/mmc/mmc.c

Quentin Armitage Quentin at Armitage.org.uk
Mon Jan 18 11:56:23 CET 2010


On Mon, 2010-01-18 at 00:31 +0100, Wolfgang Denk wrote:
> Can you please resent this patch, with your Signed-off-by: line added?
> 
Herewith patch resubmitted with Signed-off-by line added:

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;

Signed-off-by: Quentin Armitage<Quentin at Armitage.org.uk>

With regards,
Quentin Armitage




More information about the U-Boot mailing list