mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 22:26:55 +00:00
of/flattree: Fix crash when device tree absent
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>
This commit is contained in:
parent
f1d4c3a769
commit
60d5991330
1 changed files with 2 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue