summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/base/swnode.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/base/swnode.c b/drivers/base/swnode.c
index 306bb93287af..28b6eb0e5187 100644
--- a/drivers/base/swnode.c
+++ b/drivers/base/swnode.c
@@ -487,7 +487,7 @@ software_node_get_next_child(const struct fwnode_handle *fwnode,
struct software_node *p = to_software_node(fwnode);
struct software_node *c = to_software_node(child);
- if (list_empty(&p->children) ||
+ if (!p || list_empty(&p->children) ||
(c && list_is_last(&c->entry, &p->children)))
return NULL;