diff options
author | Joe Jin <lkmaillist@gmail.com> | 2007-02-06 17:16:40 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-02-08 15:38:59 -0500 |
commit | 243cb4e56061c3f4cb76312c5527840344d57c3b (patch) | |
tree | b859dc994bd6a1eb9267572180bc206331bfbac3 /drivers/net | |
parent | 6b31a515e3401685cdab2eeb6692f1a0f53f72ca (diff) |
[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')
-rw-r--r-- | drivers/net/bonding/bond_alb.c | 4 | ||||
-rw-r--r-- | drivers/net/bonding/bond_main.c | 4 |
2 files changed, 2 insertions, 6 deletions
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c index 32923162179e..217a2eedee0a 100644 --- a/drivers/net/bonding/bond_alb.c +++ b/drivers/net/bonding/bond_alb.c | |||
@@ -184,7 +184,7 @@ static int tlb_initialize(struct bonding *bond) | |||
184 | 184 | ||
185 | spin_lock_init(&(bond_info->tx_hashtbl_lock)); | 185 | spin_lock_init(&(bond_info->tx_hashtbl_lock)); |
186 | 186 | ||
187 | new_hashtbl = kmalloc(size, GFP_KERNEL); | 187 | new_hashtbl = kzalloc(size, GFP_KERNEL); |
188 | if (!new_hashtbl) { | 188 | if (!new_hashtbl) { |
189 | printk(KERN_ERR DRV_NAME | 189 | printk(KERN_ERR DRV_NAME |
190 | ": %s: Error: Failed to allocate TLB hash table\n", | 190 | ": %s: Error: Failed to allocate TLB hash table\n", |
@@ -195,8 +195,6 @@ static int tlb_initialize(struct bonding *bond) | |||
195 | 195 | ||
196 | bond_info->tx_hashtbl = new_hashtbl; | 196 | bond_info->tx_hashtbl = new_hashtbl; |
197 | 197 | ||
198 | memset(bond_info->tx_hashtbl, 0, size); | ||
199 | |||
200 | for (i = 0; i < TLB_HASH_TABLE_SIZE; i++) { | 198 | for (i = 0; i < TLB_HASH_TABLE_SIZE; i++) { |
201 | tlb_init_table_entry(&bond_info->tx_hashtbl[i], 1); | 199 | tlb_init_table_entry(&bond_info->tx_hashtbl[i], 1); |
202 | } | 200 | } |
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) | |||
1343 | "inaccurate.\n", bond_dev->name, slave_dev->name); | 1343 | "inaccurate.\n", bond_dev->name, slave_dev->name); |
1344 | } | 1344 | } |
1345 | 1345 | ||
1346 | new_slave = kmalloc(sizeof(struct slave), GFP_KERNEL); | 1346 | new_slave = kzalloc(sizeof(struct slave), GFP_KERNEL); |
1347 | if (!new_slave) { | 1347 | if (!new_slave) { |
1348 | res = -ENOMEM; | 1348 | res = -ENOMEM; |
1349 | goto err_undo_flags; | 1349 | goto err_undo_flags; |
1350 | } | 1350 | } |
1351 | 1351 | ||
1352 | memset(new_slave, 0, sizeof(struct slave)); | ||
1353 | |||
1354 | /* save slave's original flags before calling | 1352 | /* save slave's original flags before calling |
1355 | * netdev_set_master and dev_open | 1353 | * netdev_set_master and dev_open |
1356 | */ | 1354 | */ |