Skip to contentSkip to conversation

fix OOPS in bonding driver, when removing primary

PATCH In review Amir Noam 1 participant 1 message Sep 4, 2003

Subsystems (3)
lore
Share & tools
lore

Amir Noam

author
#0 lore raw

PATCH 6/10 fix OOPS in bonding driver, when removing primary

drivers/net/bonding/bond_main.c +4 -4
diff -Nuarp a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
@@ -1941,6 +1941,10 @@ static int bond_release(struct net_devic
 			/* release the slave from its bond */
 			bond_detach_slave(bond, our_slave);
 
+			if (bond->primary_slave == our_slave) {
+				bond->primary_slave = NULL;
+			}
+
 			printk (KERN_INFO "%s: releasing %s interface %s",
 				master->name,
 				(our_slave->state == BOND_STATE_ACTIVE) ? "active" : "backup",
@@ -1957,10 +1961,6 @@ static int bond_release(struct net_devic
 				printk(KERN_INFO
 					"%s: now running without any active interface !\n",
 					master->name);
-			}
-
-			if (bond->primary_slave == our_slave) {
-				bond->primary_slave = NULL;
 			}
 
 			if ((bond_mode == BOND_MODE_TLB) ||