diff options
author | Catalin Marinas <catalin.marinas@arm.com> | 2012-11-16 10:14:38 -0500 |
---|---|---|
committer | Rob Herring <rob.herring@calxeda.com> | 2012-11-20 23:58:53 -0500 |
commit | 0fca5deafeac764c2ab0d37c2409fdd0962d5724 (patch) | |
tree | 3886c78f4b5058b52b6f043e1b25b804297bd839 /drivers/of | |
parent | 6872a3173501f16aee5ce160359d1bb513d06a59 (diff) |
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 <catalin.marinas@arm.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Diffstat (limited to 'drivers/of')
-rw-r--r-- | drivers/of/fdt.c | 3 |
1 files changed, 2 insertions, 1 deletions
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, | |||
186 | */ | 186 | */ |
187 | fpsize = 1; | 187 | fpsize = 1; |
188 | allocl = 2; | 188 | allocl = 2; |
189 | l = 0; | 189 | l = 1; |
190 | *pathp = '\0'; | ||
190 | } else { | 191 | } else { |
191 | /* account for '/' and path size minus terminal 0 | 192 | /* account for '/' and path size minus terminal 0 |
192 | * already in 'l' | 193 | * already in 'l' |