Skip to content

Commit

Permalink
Merge pull request #7953 from davidsaada/david_is_valid_erase_fix
Browse files Browse the repository at this point in the history
Fix is_valid_erase function to use get_erase_size with address
  • Loading branch information
Cruz Monrreal committed Sep 27, 2018
2 parents 9bd17d3 + ff7858a commit 6b85ec7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions features/storage/blockdevice/BlockDevice.h
Expand Up @@ -226,8 +226,8 @@ class BlockDevice
bool is_valid_erase(bd_addr_t addr, bd_size_t size) const
{
return (
addr % get_erase_size() == 0 &&
size % get_erase_size() == 0 &&
addr % get_erase_size(addr) == 0 &&
(addr + size) % get_erase_size(addr + size - 1) == 0 &&
addr + size <= this->size());
}
};
Expand Down

0 comments on commit 6b85ec7

Please sign in to comment.