Skip to content

Commit

Permalink
[PATCH] gianfar mii needs to zero out the mii_bus structure
Browse files Browse the repository at this point in the history
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: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
  • Loading branch information
Kumar Gala authored and Jeff Garzik committed Nov 11, 2005
1 parent 1387780 commit 125d128
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/gianfar_mii.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ int gfar_mdio_probe(struct device *dev)
if (NULL == dev)
return -EINVAL;

new_bus = kmalloc(sizeof(struct mii_bus), GFP_KERNEL);
new_bus = kzalloc(sizeof(struct mii_bus), GFP_KERNEL);

if (NULL == new_bus)
return -ENOMEM;
Expand Down

0 comments on commit 125d128

Please sign in to comment.