[PATCH] gianfar mii needs to zero out the mii_bus structure
authorKumar Gala <[email protected]>
Wed, 9 Nov 2005 18:13:11 +0000 (12:13 -0600)
committerJeff Garzik <[email protected]>
Fri, 11 Nov 2005 13:26:58 +0000 (08:26 -0500)
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 <[email protected]>
Signed-off-by: Jeff Garzik <[email protected]>
drivers/net/gianfar_mii.c

index 7263395d78bbb6e3ccbf1f128b083f2f7abd16f7..9544279e8bcde06fef3a56e7e37bb8367b5cc517 100644 (file)
@@ -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;