]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/bonding/bond_alb.c
bonding: fix panic when taking bond interface down before removing module
[linux-2.6-omap-h63xx.git] / drivers / net / bonding / bond_alb.c
index ade5f3f6693bef27e4d006d2b370ace1956339af..87437c788476ab8a05df31a0f7fd1887ffeef497 100644 (file)
@@ -169,11 +169,14 @@ static void tlb_clear_slave(struct bonding *bond, struct slave *slave, int save_
        /* clear slave from tx_hashtbl */
        tx_hash_table = BOND_ALB_INFO(bond).tx_hashtbl;
 
-       index = SLAVE_TLB_INFO(slave).head;
-       while (index != TLB_NULL_INDEX) {
-               u32 next_index = tx_hash_table[index].next;
-               tlb_init_table_entry(&tx_hash_table[index], save_load);
-               index = next_index;
+       /* skip this if we've already freed the tx hash table */
+       if (tx_hash_table) {
+               index = SLAVE_TLB_INFO(slave).head;
+               while (index != TLB_NULL_INDEX) {
+                       u32 next_index = tx_hash_table[index].next;
+                       tlb_init_table_entry(&tx_hash_table[index], save_load);
+                       index = next_index;
+               }
        }
 
        tlb_init_slave(slave);