of: Drop properties with "/" in their name

Some bogus firmwares include properties with "/" in their name. This
causes problems when creating the /proc/device-tree file system,
because the slash is taken to indicate a directory.

We don't care about those properties, and we don't want to encourage
them, so just throw them away when creating /proc/device-tree.

Signed-off-by: Michael Ellerman <[email protected]>
Tested-by: Christian Kujau <[email protected]>
Signed-off-by: Grant Likely <[email protected]>
This commit is contained in:
Michael Ellerman 2010-05-19 02:32:29 +00:00 • committed by Grant Likely
commit 9f069af5b6

View file

@ -209,6 +209,9 @@ void proc_device_tree_add_node(struct device_node *np,
for (pp = np->properties; pp != NULL; pp = pp->next) {
p = pp->name;
if (strchr(p, '/'))
continue;
if (duplicate_name(de, p))
p = fixup_name(np, de, p);