From c9f96f8c1cb0d1715b7a8c89e9d2eafe91eca0b2 Mon Sep 17 00:00:00 2001 From: Mitch Williams Date: Wed, 9 Nov 2005 10:35:30 -0800 Subject: [PATCH] --- yaml --- r: 15713 b: refs/heads/master c: 0d206a3af4329bd833cfa5fe1cc7fe146e49c131 h: refs/heads/master i: 15711: 8aafbbf8b4f3c6aefc7a1d9c49b65d8b329857d0 v: v3 --- [refs] | 2 +- trunk/drivers/net/bonding/bond_alb.c | 22 ++++++++++++---------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/[refs] b/[refs] index 8503cb4f5238..cf2349f7a362 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 0f418b2ac49e97b7b763e0473320a201eec15ed3 +refs/heads/master: 0d206a3af4329bd833cfa5fe1cc7fe146e49c131 diff --git a/trunk/drivers/net/bonding/bond_alb.c b/trunk/drivers/net/bonding/bond_alb.c index 96dfb90c5252..e8d10f3cb1b5 100644 --- a/trunk/drivers/net/bonding/bond_alb.c +++ b/trunk/drivers/net/bonding/bond_alb.c @@ -198,20 +198,21 @@ static int tlb_initialize(struct bonding *bond) { struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond)); int size = TLB_HASH_TABLE_SIZE * sizeof(struct tlb_client_info); + struct tlb_client_info *new_hashtbl; int i; spin_lock_init(&(bond_info->tx_hashtbl_lock)); - _lock_tx_hashtbl(bond); - - bond_info->tx_hashtbl = kmalloc(size, GFP_KERNEL); - if (!bond_info->tx_hashtbl) { + new_hashtbl = kmalloc(size, GFP_KERNEL); + if (!new_hashtbl) { printk(KERN_ERR DRV_NAME ": %s: Error: Failed to allocate TLB hash table\n", bond->dev->name); - _unlock_tx_hashtbl(bond); return -1; } + _lock_tx_hashtbl(bond); + + bond_info->tx_hashtbl = new_hashtbl; memset(bond_info->tx_hashtbl, 0, size); @@ -800,21 +801,22 @@ static int rlb_initialize(struct bonding *bond) { struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond)); struct packet_type *pk_type = &(BOND_ALB_INFO(bond).rlb_pkt_type); + struct rlb_client_info *new_hashtbl; int size = RLB_HASH_TABLE_SIZE * sizeof(struct rlb_client_info); int i; spin_lock_init(&(bond_info->rx_hashtbl_lock)); - _lock_rx_hashtbl(bond); - - bond_info->rx_hashtbl = kmalloc(size, GFP_KERNEL); - if (!bond_info->rx_hashtbl) { + new_hashtbl = kmalloc(size, GFP_KERNEL); + if (!new_hashtbl) { printk(KERN_ERR DRV_NAME ": %s: Error: Failed to allocate RLB hash table\n", bond->dev->name); - _unlock_rx_hashtbl(bond); return -1; } + _lock_rx_hashtbl(bond); + + bond_info->rx_hashtbl = new_hashtbl; bond_info->rx_hashtbl_head = RLB_NULL_INDEX;