From: Øyvind Harboe Date: Fri, 21 Oct 2011 23:09:32 +0000 (+0200) Subject: kinetis: fix warning about malloc(0) w/assert X-Git-Tag: v0.6.0-rc1~512 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d5b5f9f4fd1a2781600cc74a54d5c9a2b7e09e87;p=openocd kinetis: fix warning about malloc(0) w/assert Change-Id: Ib40204675bfc5429c744f9ed7e2f7098384b753d Signed-off-by: Øyvind Harboe Reviewed-on: http://openocd.zylin.com/47 Tested-by: jenkins Reviewed-by: Øyvind Harboe --- 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++) {