Skip to contentSkip to conversation

of/fdt: Don't copy garbage after "/" in root node path

PATCH Applied Benjamin Herrenschmidt 2 participants 2 messages Oct 22, 2012 – Nov 11, 2012 Device tree

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 of/fdt: Don't copy garbage after "/" in root node path

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.

---
 drivers/of/fdt.c |    1 +
 1 file changed, 1 insertion(+)
drivers/of/fdt.c +1 -0
index 91a375f..c2b08dc 100644
@@ -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'
Applied
#1 lore raw
Quoted 9 lines · Benjamin Herrenschmidt

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.

Applied. Thanks.

Rob

Quoted 23 lines
---
 drivers/of/fdt.c |    1 +
 1 file changed, 1 insertion(+)
drivers/of/fdt.c +1 -0
index 91a375f..c2b08dc 100644
@@ -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'

_______________________________________________
devicetree-discuss mailing list devicetree-discuss-uLR06cmDAlY/[email protected]
https://lists.ozlabs.org/listinfo/devicetree-discuss