kinetis: fix warning about malloc(0) w/assert
Change-Id: Ib40204675bfc5429c744f9ed7e2f7098384b753d Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/47 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
This commit is contained in:
parent
2c31adb31d
commit
d5b5f9f4fd
|
@ -467,6 +467,7 @@ static int kinetis_probe(struct flash_bank *bank)
|
|||
}
|
||||
|
||||
bank->num_sectors = bank->size / (2 * 1024);
|
||||
assert(bank->num_sectors > 0);
|
||||
bank->sectors = malloc(sizeof(struct flash_sector) * bank->num_sectors);
|
||||
|
||||
for (i = 0; i < bank->num_sectors; i++) {
|
||||
|
|
Loading…
Reference in New Issue