Skip to content

Commit

Permalink
of/fdt: NULL-terminate the root node path
Browse files Browse the repository at this point in the history
Commit 509b745 (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>
  • Loading branch information
ctmarinas authored and Rob Herring committed Nov 21, 2012
1 parent 6872a31 commit 0fca5de
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/of/fdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 0fca5de

Please sign in to comment.