diff options
author | Wolfgang Denk <wd@denx.de> | 2010-03-11 23:35:43 +0100 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2010-03-11 23:35:43 +0100 |
commit | 8c4444ff5e1d8e9fd1a847a2fb096aa9aff66f85 (patch) | |
tree | 8fe834f4fc0d1d3af866b3ac2c4039b32c602c20 /drivers/mmc/mmc.c | |
parent | 6258b04e9a41ee60f21547358a58fbcb9087735d (diff) | |
download | u-boot-8c4444ff5e1d8e9fd1a847a2fb096aa9aff66f85.tar.gz u-boot-8c4444ff5e1d8e9fd1a847a2fb096aa9aff66f85.tar.xz u-boot-8c4444ff5e1d8e9fd1a847a2fb096aa9aff66f85.zip |
Fix memory leak in mmc_read()
There is be a path through mmc_read in drivers/mmc/mmc.c where
malloc'd memory is not freed before exiting mmc_read: it occurs if
mmc_set_blocklen() returns a non-zero value.
Reported-by: Quentin Armitage <Quentin@Armitage.org.uk>
Signed-off-by: Wolfgang Denk <wd@denx.de>
Diffstat (limited to 'drivers/mmc/mmc.c')
-rw-r--r-- | drivers/mmc/mmc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index 367922579c..cf4ea161b9 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -179,7 +179,7 @@ int mmc_read(struct mmc *mmc, u64 src, uchar *dst, int size) 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; |