diff options
author | Jörg Hohensohn <hohensoh@rockbox.org> | 2005-03-10 05:43:44 +0000 |
---|---|---|
committer | Jörg Hohensohn <hohensoh@rockbox.org> | 2005-03-10 05:43:44 +0000 |
commit | fe0e368d5ca62a1b97c783f6f4b4c1d4245f02b5 (patch) | |
tree | d5e990d194a46877cde47086a15f6e680a05e875 | |
parent | 2dddde253f5bb68c3cf3e60646e0f39220bcb9bb (diff) | |
download | rockbox-fe0e368d5ca62a1b97c783f6f4b4c1d4245f02b5.tar.gz rockbox-fe0e368d5ca62a1b97c783f6f4b4c1d4245f02b5.zip |
Don't panic on read attempts past end of card, just exit with error. Such can happen when mounting superfloppy MMC, without valid partition table.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6179 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | firmware/drivers/ata_mmc.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/firmware/drivers/ata_mmc.c b/firmware/drivers/ata_mmc.c index 17ec9774c4..c370c5f69e 100644 --- a/firmware/drivers/ata_mmc.c +++ b/firmware/drivers/ata_mmc.c | |||
@@ -647,7 +647,11 @@ int ata_read_sectors(IF_MV2(int drive,) | |||
647 | ret = select_card(current_card); | 647 | ret = select_card(current_card); |
648 | #endif | 648 | #endif |
649 | if (start + incount > card->numsectors) | 649 | if (start + incount > card->numsectors) |
650 | panicf("Reading past end of card\n"); | 650 | { |
651 | ret = -1; | ||
652 | /* panicf("Reading %d@%d, past end of card %d\n", | ||
653 | incount, start, card->numsectors); */ | ||
654 | } | ||
651 | 655 | ||
652 | /* some cards don't like reading the very last sector with | 656 | /* some cards don't like reading the very last sector with |
653 | * CMD_READ_MULTIPLE_BLOCK, so make sure this sector is always | 657 | * CMD_READ_MULTIPLE_BLOCK, so make sure this sector is always |