Skip to content

Commit

Permalink
fixup! chore(core, legacy, storage): Refactor flash drivers
Browse files Browse the repository at this point in the history
  • Loading branch information
cepetr committed Nov 6, 2023
1 parent 6a2576a commit c4d508e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/embed/trezorhal/stm32u5/flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ const void *flash_get_address(uint16_t sector, uint32_t offset, uint32_t size) {
return NULL;
}

if (offset + size > FLASH_PAGE_SIZE) {
if (sector * FLASH_PAGE_SIZE + offset + size >
FLASH_PAGE_SIZE * FLASH_SECTOR_COUNT) {
return NULL;
}

Expand Down

0 comments on commit c4d508e

Please sign in to comment.