提交 75c6d141 编写于 作者: C Cyrill Gorcunov 提交者: David S. Miller

[SPARC64]: check for possible NULL pointer dereference

This patch adds checking for possible NULL pointer dereference
if of_find_property() failed.
Signed-off-by: NCyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 794b26e0
......@@ -1022,6 +1022,10 @@ void __init sun4v_pci_init(struct device_node *dp, char *model_name)
}
prop = of_find_property(dp, "reg", NULL);
if (!prop) {
prom_printf("SUN4V_PCI: Could not find config registers\n");
prom_halt();
}
regs = prop->value;
devhandle = (regs->phys_addr >> 32UL) & 0x0fffffff;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册