lkml.org 
[lkml]   [2017]   [May]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/2] fdt: correctly handle uncompressed node names
Date
When handling uncompressed node names, we need to compare the last
component rather than the entire string.

Signed-off-by: Sascha Silbe <x-linux@infra-silbe.de>
---
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
\
 
 \ /
  Last update: 2017-05-13 12:31    [W:0.067 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site