From: Catalin Marinas Date: Fri, 16 Nov 2012 15:14:38 +0000 (+0000) Subject: of/fdt: NULL-terminate the root node path X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0fca5deafeac764c2ab0d37c2409fdd0962d5724;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git of/fdt: NULL-terminate the root node path Commit 509b7455 (of/fdt: Don't copy garbage after "/" in root node path) sets the path length to 0 to ignore any garbage after "/" in the root node path. This has the side effect of also ignoring '\0' at the end of the root node path. This patch sets the ignores the garbage by setting the last character to '\0' and length to 1. Signed-off-by: Catalin Marinas Cc: Benjamin Herrenschmidt Signed-off-by: Rob Herring --- diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index 135b8083212a..e36ff40011f4 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -186,7 +186,8 @@ static unsigned long unflatten_dt_node(struct boot_param_header *blob, */ fpsize = 1; allocl = 2; - l = 0; + l = 1; + *pathp = '\0'; } else { /* account for '/' and path size minus terminal 0 * already in 'l'