Skip to content

Commit

Permalink
of/fdt: Don't copy garbage after "/" in root node path
Browse files Browse the repository at this point in the history
The root node path must be internally converted to "/", or various
pieces of code looking for it that way will fail. The code to do
that however had a bug where we might incorrectly append pieces
of the original path from the fdt to the "/".

We should probably add a proper dedicated accessor for the root node
but in the meantime this patch should fix it.

Signed-off-by: Benjamin Herrenschmidt <[email protected]>
Signed-off-by: Rob Herring <[email protected]>
  • Loading branch information
ozbenh authored and Rob Herring committed Nov 11, 2012
1 parent 2066306 commit 509b745
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/of/fdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ static unsigned long unflatten_dt_node(struct boot_param_header *blob,
*/
fpsize = 1;
allocl = 2;
l = 0;
} else {
/* account for '/' and path size minus terminal 0
* already in 'l'
Expand Down

0 comments on commit 509b745

Please sign in to comment.