Filesystem: Remove invalid write to unallocated memory in heap block device

pull/3762/head
Christopher Haster 2017-02-23 20:41:38 -06:00
parent 2d41da2c63
commit 2cf67734c4
1 changed files with 1 additions and 11 deletions

View File

@ -134,17 +134,7 @@ int HeapBlockDevice::program(const void *b, bd_addr_t addr, bd_size_t size)
int HeapBlockDevice::erase(bd_addr_t addr, bd_size_t size)
{
MBED_ASSERT(is_valid_erase(addr, size));
while (size > 0) {
bd_addr_t hi = addr / _erase_size;
if (_blocks[hi]) {
memset(_blocks[hi], 0xcc, _erase_size);
}
addr += _erase_size;
size -= _erase_size;
}
// TODO assert on programming unerased blocks
return 0;
}