ffat: Release packets in block session backend

This patch adds the necessary 'release_packet()' calls in the block
session backend of the 'ffat' lib.

Fixes #272.
This commit is contained in:
Christian Prochaska 2012-07-09 16:35:05 +02:00 committed by Norman Feske
parent 69ec6f5dd8
commit b2a62b4b2d

View File

@ -112,6 +112,7 @@ extern "C" DRESULT disk_read(BYTE drv, BYTE *buff, DWORD sector, BYTE count)
/* check for success of operation */
if (!p.succeeded()) {
PERR("Could not read block(s)");
_source->release_packet(p);
return RES_ERROR;
}
@ -124,6 +125,7 @@ extern "C" DRESULT disk_read(BYTE drv, BYTE *buff, DWORD sector, BYTE count)
PDBG("%8x: %2x %c", i, buff[i], buff[i] >= 32 ? buff[i] : '-');
#endif
_source->release_packet(p);
return RES_OK;
}
@ -152,9 +154,11 @@ extern "C" DRESULT disk_write(BYTE drv, const BYTE *buff, DWORD sector, BYTE cou
/* check for success of operation */
if (!p.succeeded()) {
PERR("Could not write block(s)");
_source->release_packet(p);
return RES_ERROR;
}
_source->release_packet(p);
return RES_OK;
}
#endif /* _READONLY */