devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] of/fdt: NULL-terminate the root node path
@ 2012-11-16 15:14 Catalin Marinas
  2012-11-16 15:16 ` Catalin Marinas
  0 siblings, 1 reply; 3+ messages in thread
From: Catalin Marinas @ 2012-11-16 15:14 UTC (permalink / raw)
  To: devicetree-discuss; +Cc: linux-kernel, Benjamin Herrenschmidt, Rob Herring

From: Benjamin Herrenschmidt <benh@kernel.crashing.org>

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 <catalin.marinas@arm.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Rob Herring <rob.herring@calxeda.com>
---

The patch is against linux-next, not sure whether mainline will get the
same commit number. Please feel free to fold it into the original patch,
whichever is easier. Without this I can't boot arm64, doesn't populate
the platform devices.

 drivers/of/fdt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index 73fb8c0..d9b2207 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'

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-11-16 15:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-16 15:14 [PATCH] of/fdt: NULL-terminate the root node path Catalin Marinas
2012-11-16 15:16 ` Catalin Marinas
2012-11-16 15:38   ` Rob Herring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).