From b2a62b4b2d161e126e50372a90ba4c6afa1ebe08 Mon Sep 17 00:00:00 2001 From: Christian Prochaska Date: Mon, 9 Jul 2012 16:35:05 +0200 Subject: [PATCH] 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. --- libports/src/lib/ffat/diskio_block.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libports/src/lib/ffat/diskio_block.cc b/libports/src/lib/ffat/diskio_block.cc index a3964f087d..6d8f747479 100644 --- a/libports/src/lib/ffat/diskio_block.cc +++ b/libports/src/lib/ffat/diskio_block.cc @@ -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 */