From d5b5f9f4fd1a2781600cc74a54d5c9a2b7e09e87 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=98yvind=20Harboe?= Date: Sat, 22 Oct 2011 01:09:32 +0200 Subject: [PATCH] kinetis: fix warning about malloc(0) w/assert MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Change-Id: Ib40204675bfc5429c744f9ed7e2f7098384b753d Signed-off-by: Øyvind Harboe Reviewed-on: http://openocd.zylin.com/47 Tested-by: jenkins Reviewed-by: Øyvind Harboe --- src/flash/nor/kinetis.c | 1 + 1 file changed, 1 insertion(+) 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++) { -- 2.39.5