aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorØyvind Harboe <oyvind.harboe@zylin.com>2011-10-22 01:09:32 +0200
committerØyvind Harboe <oyvindharboe@gmail.com>2011-10-23 13:26:53 +0000
commitd5b5f9f4fd1a2781600cc74a54d5c9a2b7e09e87 (patch)
treed386041e5accde2cc2276f1dc0045d891cf8665e
parent2c31adb31df0fa7608dd5a0fe3ba0acb1cee6a04 (diff)
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>
-rw-r--r--src/flash/nor/kinetis.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/flash/nor/kinetis.c b/src/flash/nor/kinetis.c
index 26135222..ecc60bec 100644
--- a/src/flash/nor/kinetis.c
+++ b/src/flash/nor/kinetis.c
@@ -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++) {