diff --git a/drivers/base/property.c b/drivers/base/property.c index 1e6d75e65938fb8247c66adb3baa6181f8058920..d58aa98fe9645703b5be22c16d89241f663600a5 100644 --- a/drivers/base/property.c +++ b/drivers/base/property.c @@ -721,7 +721,7 @@ struct fwnode_handle *device_get_next_child_node(struct device *dev, return next; /* When no more children in primary, continue with secondary */ - if (!IS_ERR_OR_NULL(fwnode->secondary)) + if (fwnode && !IS_ERR_OR_NULL(fwnode->secondary)) next = fwnode_get_next_child_node(fwnode->secondary, child); return next;