[U-Boot] [PATCH] tools: ifdtool: Do not write region while its size is negative

Bin Meng bmeng.cn at gmail.com
Sun May 31 08:57:35 CEST 2015


We should ignore those regions whose size is negative. These are
typically optional and unused regions (like GbE and platform data).

Signed-off-by: Bin Meng <bmeng.cn at gmail.com>
---

 tools/ifdtool.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/ifdtool.c b/tools/ifdtool.c
index 590ccc9..1d61df1 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 |
-- 
1.8.2.1



More information about the U-Boot mailing list