From: Zhang Wei <wei.zhang@freescale.com>
Date: Mon, 28 Aug 2006 06:25:31 +0000 (+0800)
Subject: Fixed an OF-tree off-by-one bug when adding a new property name.
X-Git-Tag: v2025.01-rc5-pxa1908~22941^2~3^2~27^2
X-Git-Url: http://git.dujemihanovic.xyz/img/static/html/index.html?a=commitdiff_plain;h=2f15776ccc6dc32377d8ba9652b8f58059c27c6d;p=u-boot.git

Fixed an OF-tree off-by-one bug when adding a new property name.
This bug will cause the kernel booting to pause a long time.

Signed-off-by: Zhang Wei <wei.zhang@freescale.com>
---

diff --git a/common/ft_build.c b/common/ft_build.c
index b5a997c1ba..b5937e35f7 100644
--- a/common/ft_build.c
+++ b/common/ft_build.c
@@ -103,7 +103,7 @@ void ft_prop(struct ft_cxt *cxt, const char *name, const void *data, int sz)
 	if (off == -1) {
 		memcpy(cxt->p_end, name, strlen(name) + 1);
 		off = cxt->p_end - cxt->p;
-		cxt->p_end += strlen(name) + 2;
+		cxt->p_end += strlen(name) + 1;
 	}
 
 	/* now put offset from beginning of *STRUCTURE* */