Skip to content

Commit

Permalink
of/flattree: Fix crash when device tree absent
Browse files Browse the repository at this point in the history
This patch fixes the condition where device tree support is compiled
in, but no device tree was proved by firmware.  It makes
of_platform_bus_probe() explicitly check for a NULL device tree
pointer.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
  • Loading branch information
Grant Likely committed Jul 19, 2010
1 parent f1d4c3a commit 60d5991
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/of/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,8 @@ int of_platform_bus_probe(struct device_node *root,
root = of_find_node_by_path("/");
else
of_node_get(root);
if (root == NULL)
return -EINVAL;

pr_debug("of_platform_bus_probe()\n");
pr_debug(" starting at: %s\n", root->full_name);
Expand Down

0 comments on commit 60d5991

Please sign in to comment.