提交 b8c19eb1 编写于 作者: G Grant Likely 提交者: Paul Mackerras

[POWERPC] mpc5200-fec: Fix possible NULL dereference in mdio driver

If the reg property is missing from the phy node (unlikely, but possible),
then the kernel will oops with a NULL pointer dereference.  This fixes
it by checking the pointer first.
Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
Signed-off-by: NPaul Mackerras <paulus@samba.org>
上级 1428a9fa
......@@ -109,6 +109,7 @@ static int mpc52xx_fec_mdio_probe(struct of_device *of, const struct of_device_i
int irq = irq_of_parse_and_map(child, 0);
if (irq != NO_IRQ) {
const u32 *id = of_get_property(child, "reg", NULL);
if (id)
bus->irq[*id] = irq;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册