fix the fix: use sector_map_size

Being stabic is no excuse for not looking twice, David :D.
Reported-by: 's avatarRene Geissler <R.Geissler@gsi.de>
parent 0af64366
...@@ -246,13 +246,13 @@ int flash_program(uint32_t addr, const uint8_t * data, int size, uint32_t flash_ ...@@ -246,13 +246,13 @@ int flash_program(uint32_t addr, const uint8_t * data, int size, uint32_t flash_
else else
return -ENODEV; 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); sector_map = (int *)malloc(sector_map_size);
if (sector_map == NULL) if (sector_map == NULL)
return -ENOMEM; return -ENOMEM;
memset(sector_map, 0, sector_size); memset(sector_map, 0, sector_map_size);
const uint8_t *p = data; 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