mirror of
https://github.com/eclipse-threadx/levelx.git
synced 2026-09-14 04:06:00 +08:00
fix: Wrong out of range check in lx_nand_flash_block_find
Fix issue 53 Signed-off-by: Haithem Rahmani <haithem.rahmani@st.com>
This commit is contained in:
@@ -90,7 +90,7 @@ UINT _lx_nand_flash_block_find(LX_NAND_FLASH *nand_flash, ULONG logical_sector,
|
|||||||
block_mapping_index = logical_sector / nand_flash -> lx_nand_flash_pages_per_block;
|
block_mapping_index = logical_sector / nand_flash -> lx_nand_flash_pages_per_block;
|
||||||
|
|
||||||
/* Check the address range. */
|
/* Check the address range. */
|
||||||
if (block_mapping_index > nand_flash -> lx_nand_flash_block_mapping_table_size / sizeof(*nand_flash -> lx_nand_flash_block_mapping_table))
|
if (block_mapping_index >= nand_flash -> lx_nand_flash_block_mapping_table_size / sizeof(*nand_flash -> lx_nand_flash_block_mapping_table))
|
||||||
{
|
{
|
||||||
|
|
||||||
/* Out of range, return an error. */
|
/* Out of range, return an error. */
|
||||||
|
|||||||
Reference in New Issue
Block a user