of: Fix invalid path for of_find_node_by_path
When of_find_node_by_path is called with a non existing path we return just some node. return NULL instead. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
f30b191e36
commit
99bb8de76f
|
@ -487,9 +487,10 @@ struct device_node *of_find_node_by_path(const char *path)
|
|||
|
||||
list_for_each_entry(np, &allnodes, list) {
|
||||
if (np->full_name && (strcmp(np->full_name, path) == 0))
|
||||
break;
|
||||
return np;
|
||||
}
|
||||
return np;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
EXPORT_SYMBOL(of_find_node_by_path);
|
||||
|
||||
|
|
Loading…
Reference in New Issue