mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #7299 from ARMmbed/g-fix-mbr-invalid
MBR: Fix issue with MBR init asserting on bad partition sizepull/7324/head
commit
8756183478
|
|
@ -241,7 +241,9 @@ int MBRBlockDevice::init()
|
|||
_size = fromle32(table->entries[_part-1].lba_size) * sector;
|
||||
|
||||
// Check that block addresses are valid
|
||||
MBED_ASSERT(_bd->is_valid_erase(_offset, _size));
|
||||
if (!_bd->is_valid_erase(_offset, _size)) {
|
||||
return BD_ERROR_INVALID_PARTITION;
|
||||
}
|
||||
|
||||
delete[] buffer;
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in New Issue