diff options
author | Wolfgang Denk <wd@denx.de> | 2010-09-21 09:34:16 +0200 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2010-09-21 09:34:16 +0200 |
commit | 0cc89de8ef60214083739904b011f6c255922723 (patch) | |
tree | 17adeeae646a93fb7ee1e331915123cd8814a6df /drivers | |
parent | 6561863678822847be92c3bd06ae1d64acca4f6a (diff) | |
parent | 07517e7f4f582d1607adbc444bab75af3ac4a7f9 (diff) | |
download | u-boot-imx-0cc89de8ef60214083739904b011f6c255922723.zip u-boot-imx-0cc89de8ef60214083739904b011f6c255922723.tar.gz u-boot-imx-0cc89de8ef60214083739904b011f6c255922723.tar.bz2 |
Merge branch 'master' of /home/wd/git/u-boot/master
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mmc/mmc.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index cf4ea16..80cd9bf 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -92,6 +92,11 @@ mmc_bwrite(int dev_num, ulong start, lbaint_t blkcnt, const void*src) blklen = mmc->write_bl_len; + if ((start + blkcnt) > mmc->block_dev.lba) { + printf("MMC: block number 0x%lx exceeds max(0x%lx)", + start + blkcnt, mmc->block_dev.lba); + return 0; + } err = mmc_set_blocklen(mmc, mmc->write_bl_len); if (err) { @@ -219,6 +224,11 @@ static ulong mmc_bread(int dev_num, ulong start, lbaint_t blkcnt, void *dst) if (!mmc) return 0; + if ((start + blkcnt) > mmc->block_dev.lba) { + printf("MMC: block number 0x%lx exceeds max(0x%lx)", + start + blkcnt, mmc->block_dev.lba); + return 0; + } /* We always do full block reads from the card */ err = mmc_set_blocklen(mmc, mmc->read_bl_len); |