[PATCH 1/2] fdt: correctly handle uncompressed node names

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

 




When handling uncompressed node names, we need to compare the last
component rather than the entire string.

Signed-off-by: Sascha Silbe <x-linux@xxxxxxxxxxxxxx>
---
 scripts/dtc/libfdt/fdt_ro.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/scripts/dtc/libfdt/fdt_ro.c b/scripts/dtc/libfdt/fdt_ro.c
index 3d00d2eee0e3..ca03ff87429c 100644
--- a/scripts/dtc/libfdt/fdt_ro.c
+++ b/scripts/dtc/libfdt/fdt_ro.c
@@ -64,6 +64,9 @@ static int _fdt_nodename_eq(const void *fdt, int offset,
 		/* short match */
 		return 0;
 
+	if (*p == '/')
+		/* Uncompressed node name. Only compare the last part. */
+		p = strrchr(p, '/') + 1;
 	if (memcmp(p, s, len) != 0)
 		return 0;
 
-- 
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