mirror of
https://github.com/dgibson/dtc.git
synced 2025-10-14 00:37:41 -04:00
When determining if to recurse into a node, get_node_by_path does not check if the length of each node name is equal. If searching for /foo/baz, this can result in recursing into /foobar because strneq("foo", "foobar", 3) is true. This can result in a reference to /foo/baz to be incorrectly set to /foobar/baz. A test for this was added. Signed-off-by: Tim Montague <tmontague@ghs.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
28 lines
449 B
Text
28 lines
449 B
Text
/dts-v1/;
|
|
|
|
/ {
|
|
rref = &{/};
|
|
/* Check multiple references case */
|
|
multiref = &n1 , &n2;
|
|
n1: node1 {
|
|
ref = &{/node2}; /* reference precedes target */
|
|
lref = &n2;
|
|
};
|
|
n2: node2 {
|
|
ref = &{/node1}; /* reference after target */
|
|
lref = &n1;
|
|
};
|
|
/* Check references to nested nodes with common prefix */
|
|
foobar {
|
|
n3: baz {
|
|
ref = &{/foo/baz};
|
|
lref = &n4;
|
|
};
|
|
};
|
|
foo {
|
|
n4: baz {
|
|
ref = &{/foobar/baz};
|
|
lref = &n3;
|
|
};
|
|
};
|
|
};
|