aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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++) {