[PATCH 2/2] of: fdt: fix unflattening of FDTs containing uncompressed paths

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Probably since commit dfbd4c6eff35 ("drivers/of: Split
unflatten_dt_node()"), unflattening an FDT containing uncompressed
node names (e.g. "/gpio@d4019000/gpio@0") will abort after scanning
the root node because fpsize wasn't updated to include the path len.

Signed-off-by: Sascha Silbe <x-linux@xxxxxxxxxxxxxx>
---
 drivers/of/fdt.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index e5ce4b59e162..2d5414e644b3 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -309,6 +309,8 @@ static unsigned int populate_node(const void *blob,
 			fpsize += l;
 			allocl = fpsize;
 		}
+	} else {
+		fpsize += allocl;
 	}
 
 	np = unflatten_dt_alloc(mem, sizeof(struct device_node) + allocl,
-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux