9
0
Fork 0

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:
Sascha Hauer 2012-10-25 17:56:40 +02:00
parent 72703410fe
commit e2fce6b92c
1 changed files with 3 additions and 0 deletions

View File

@ -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;