提交 125d128b 编写于 作者: K Kumar Gala 提交者: Jeff Garzik

[PATCH] gianfar mii needs to zero out the mii_bus structure

To ensure that phy_mask and any future elements of the mii_bus
structure are initialized use kzalloc() instead of kmalloc().

This fixes an issue in which phy_mask was not being initialized
and we would skip random phy addresses when scanning.
Signed-off-by: NKumar Gala <galak@kernel.crashing.org>
Signed-off-by: NJeff Garzik <jgarzik@pobox.com>
上级 1387780f
...@@ -133,7 +133,7 @@ int gfar_mdio_probe(struct device *dev) ...@@ -133,7 +133,7 @@ int gfar_mdio_probe(struct device *dev)
if (NULL == dev) if (NULL == dev)
return -EINVAL; return -EINVAL;
new_bus = kmalloc(sizeof(struct mii_bus), GFP_KERNEL); new_bus = kzalloc(sizeof(struct mii_bus), GFP_KERNEL);
if (NULL == new_bus) if (NULL == new_bus)
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册