Browse Source

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>
tags/v0.6.0-rc1
Øyvind Harboe 12 years ago
committed by Øyvind Harboe
parent
commit
d5b5f9f4fd
1 changed files with 1 additions and 0 deletions
  1. +1
    -0
      src/flash/nor/kinetis.c

+ 1
- 0
src/flash/nor/kinetis.c View File

@@ -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…
Cancel
Save