fix the fix: use sector_map_size

Being stabic is no excuse for not looking twice, David :D.
Reported-by: 's avatarRene Geissler <>
parent 0af64366
......@@ -246,13 +246,13 @@ int flash_program(uint32_t addr, const uint8_t * data, int size, uint32_t flash_
return -ENODEV;
sector_size = sizeof(int) * FLASH_SIZE / sector_size;
sector_map_size = sizeof(int) * FLASH_SIZE / sector_size;
sector_map = (int *)malloc(sector_map_size);
if (sector_map == NULL)
return -ENOMEM;
memset(sector_map, 0, sector_size);
memset(sector_map, 0, sector_map_size);
const uint8_t *p = data;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment