提交 60d59913 编写于 作者: G Grant Likely

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: NGrant Likely <grant.likely@secretlab.ca>
上级 f1d4c3a7
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册