Commit 1270266c authored by Stephen Hemminger's avatar Stephen Hemminger Committed by Jeff Garzik

[PATCH] chelsio: use kzalloc

Use kzalloc in several places.
Signed-off-by: default avatarStephen Hemminger <shemminger@osdl.org>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 11e5a202
...@@ -205,11 +205,11 @@ static struct cphy *mv88x201x_phy_create(adapter_t *adapter, int phy_addr, ...@@ -205,11 +205,11 @@ static struct cphy *mv88x201x_phy_create(adapter_t *adapter, int phy_addr,
struct mdio_ops *mdio_ops) struct mdio_ops *mdio_ops)
{ {
u32 val; u32 val;
struct cphy *cphy = kmalloc(sizeof(*cphy), GFP_KERNEL); struct cphy *cphy = kzalloc(sizeof(*cphy), GFP_KERNEL);
if (!cphy) if (!cphy)
return NULL; return NULL;
memset(cphy, 0, sizeof(*cphy));
cphy_init(cphy, adapter, phy_addr, &mv88x201x_ops, mdio_ops); cphy_init(cphy, adapter, phy_addr, &mv88x201x_ops, mdio_ops);
/* Commands the PHY to enable XFP's clock. */ /* Commands the PHY to enable XFP's clock. */
......
...@@ -631,10 +631,9 @@ static struct cmac *pm3393_mac_create(adapter_t *adapter, int index) ...@@ -631,10 +631,9 @@ static struct cmac *pm3393_mac_create(adapter_t *adapter, int index)
{ {
struct cmac *cmac; struct cmac *cmac;
cmac = kmalloc(sizeof(*cmac) + sizeof(cmac_instance), GFP_KERNEL); cmac = kzalloc(sizeof(*cmac) + sizeof(cmac_instance), GFP_KERNEL);
if (!cmac) if (!cmac)
return NULL; return NULL;
memset(cmac, 0, sizeof(*cmac));
cmac->ops = &pm3393_ops; cmac->ops = &pm3393_ops;
cmac->instance = (cmac_instance *) (cmac + 1); cmac->instance = (cmac_instance *) (cmac + 1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment