1
0
Fork 0
forked from len0rd/rockbox

imx233: fix sdmmc driver bug when sector count is 0

Since the driver will read count-1 sectors, this will stuck the card.

Change-Id: Ib80484044acd1fad2914d3ffeb3940a13d2480c4
This commit is contained in:
Amaury Pouly 2014-04-23 23:43:27 +02:00
parent 532b8141ab
commit 54dd77a5f8

View file

@ -596,6 +596,9 @@ static int __xfer_sectors(int drive, unsigned long start, int count, void *buf,
static int transfer_sectors(int drive, unsigned long start, int count, void *buf, bool read) static int transfer_sectors(int drive, unsigned long start, int count, void *buf, bool read)
{ {
int ret = 0; int ret = 0;
// the function doesn't work when count is 0
if(count == 0)
return ret;
/* update disk activity */ /* update disk activity */
disk_last_activity[drive] = current_tick; disk_last_activity[drive] = current_tick;