From 6c4247e98eb3b1bf7ec19b61915c803db5670ad0 Mon Sep 17 00:00:00 2001 From: Bin Meng Date: Sun, 31 May 2015 14:57:35 +0800 Subject: [PATCH] tools: ifdtool: Do not write region while its size is negative We should ignore those regions whose size is negative. These are typically optional and unused regions (like GbE and platform data). Change-Id: I65ad01746144604a1dc0588b617af21f2722ebbf Signed-off-by: Bin Meng Acked-by: Simon Glass --- tools/ifdtool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ifdtool.c b/tools/ifdtool.c index 590ccc914b..1d61df19f2 100644 --- a/tools/ifdtool.c +++ b/tools/ifdtool.c @@ -462,7 +462,7 @@ static int write_regions(char *image, int size) if (ret) return ret; dump_region(i, frba); - if (region.size == 0) + if (region.size <= 0) continue; region_fd = open(region_filename(i), O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | -- 2.39.5