of: Check for NULL pointer in of_find_property
The console layer calls of_device_is_stdout_path for a new console. When we are booting without devicetree then of_chosen is NULL which makes barebox crash. Check for a NULL pointer in of_find_property to prevent this. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
72703410fe
commit
e2fce6b92c
|
@ -105,6 +105,9 @@ struct property *of_find_property(const struct device_node *node, const char *na
|
|||
{
|
||||
struct property *p;
|
||||
|
||||
if (!node)
|
||||
return NULL;
|
||||
|
||||
list_for_each_entry(p, &node->properties, list)
|
||||
if (!strcmp(p->name, name))
|
||||
return p;
|
||||
|
|
Loading…
Reference in New Issue