summaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bond_main.c
diff options
context:
space:
mode:
authorJoe Jin <lkmaillist@gmail.com>2007-02-06 23:16:40 +0100
committerDavid S. Miller <davem@sunset.davemloft.net>2007-02-08 21:38:59 +0100
commit243cb4e56061c3f4cb76312c5527840344d57c3b (patch)
treeb859dc994bd6a1eb9267572180bc206331bfbac3 /drivers/net/bonding/bond_main.c
parent[TG3]: Avoid an expensive divide. (diff)
downloadlinux-243cb4e56061c3f4cb76312c5527840344d57c3b.tar.xz
linux-243cb4e56061c3f4cb76312c5527840344d57c3b.zip
[BONDING]: Replace kmalloc() + memset() pairs with the appropriate kzalloc() calls
Replace kmalloc() + memset() pairs with the appropriate kzalloc() calls in the bonding driver. Signed-off-by: Joe Jin <lkmaillist@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'drivers/net/bonding/bond_main.c')
-rw-r--r--drivers/net/bonding/bond_main.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index d3801a00d3d5..8ce8fec615ba 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1343,14 +1343,12 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
"inaccurate.\n", bond_dev->name, slave_dev->name);
}
- new_slave = kmalloc(sizeof(struct slave), GFP_KERNEL);
+ new_slave = kzalloc(sizeof(struct slave), GFP_KERNEL);
if (!new_slave) {
res = -ENOMEM;
goto err_undo_flags;
}
- memset(new_slave, 0, sizeof(struct slave));
-
/* save slave's original flags before calling
* netdev_set_master and dev_open
*/