From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricky Liang Subject: [PATCH] of/fdt: fix allocation size for device node path Date: Tue, 14 Apr 2015 12:36:05 +0800 Message-ID: <1428986165-6250-1-git-send-email-jcliang@chromium.org> Return-path: Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Grant Likely Cc: Ricky Liang , Rob Herring , "open list:OPEN FIRMWARE AND..." , open list List-Id: devicetree@vger.kernel.org The allocation size of device node path is off by one which drops the '\0' terminator. Signed-off-by: Ricky Liang --- drivers/of/fdt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index 3a896c9..98a9e6e 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -172,7 +172,7 @@ static void * unflatten_dt_node(void *blob, if (!pathp) return mem; - allocl = l++; + allocl = ++l; /* version 0x10 has a more compact unit name here instead of the full * path. we accumulate the full path size using "fpsize", we'll rebuild -- 2.1.2 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html