summaryrefslogtreecommitdiff
path: root/firmware/target/arm
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2011-03-20 17:04:31 +0000
committerRafaël Carré <rafael.carre@gmail.com>2011-03-20 17:04:31 +0000
commit82f2bb99ae8440439491af7c20c13bd89d53e713 (patch)
tree57ebee26a44b3a6a021929bcc668d82b9c5d8543 /firmware/target/arm
parent1675e98925fb976314c199116e37ed81e98ca530 (diff)
SD AMSv2: fix r29169
Restore access to the last AMS_OF_SIZE == 0xF000 sectors of internal drive Mostly visible when using USB (or database?) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29625 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm')
-rw-r--r--firmware/target/arm/as3525/sd-as3525v2.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/firmware/target/arm/as3525/sd-as3525v2.c b/firmware/target/arm/as3525/sd-as3525v2.c
index 39c5a01913..b0808ca1d3 100644
--- a/firmware/target/arm/as3525/sd-as3525v2.c
+++ b/firmware/target/arm/as3525/sd-as3525v2.c
@@ -845,6 +845,12 @@ static int sd_transfer_sectors(IF_MD2(int drive,) unsigned long start,
goto sd_transfer_error_no_dma;
}
+ if((start+count) > card_info[drive].numblocks)
+ {
+ ret = -19;
+ goto sd_transfer_error_no_dma;
+ }
+
/* skip SanDisk OF */
if (drive == INTERNAL_AS3525)
start += AMS_OF_SIZE;
@@ -861,12 +867,6 @@ sd_transfer_retry_with_reinit:
goto sd_transfer_error_no_dma;
}
- if((start+count) > card_info[drive].numblocks)
- {
- ret = -19;
- goto sd_transfer_error_no_dma;
- }
-
/* CMD7 w/rca: Select card to put it in TRAN state */
if(!send_cmd(drive, SD_SELECT_CARD, card_info[drive].rca, MCI_NO_RESP, NULL))
{