From fe0e368d5ca62a1b97c783f6f4b4c1d4245f02b5 Mon Sep 17 00:00:00 2001 From: Jörg Hohensohn Date: Thu, 10 Mar 2005 05:43:44 +0000 Subject: 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 --- firmware/drivers/ata_mmc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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,) ret = select_card(current_card); #endif if (start + incount > card->numsectors) - panicf("Reading past end of card\n"); + { + ret = -1; + /* panicf("Reading %d@%d, past end of card %d\n", + incount, start, card->numsectors); */ + } /* some cards don't like reading the very last sector with * CMD_READ_MULTIPLE_BLOCK, so make sure this sector is always -- cgit v1.2.3