Commit 45c72c85 authored by Amir Noam's avatar Amir Noam Committed by Stephen Hemminger

[bonding 2.6] fix OOPS in bonding driver, when removing primary

parent acd2c570
...@@ -1941,6 +1941,10 @@ static int bond_release(struct net_device *master, struct net_device *slave) ...@@ -1941,6 +1941,10 @@ static int bond_release(struct net_device *master, struct net_device *slave)
/* release the slave from its bond */ /* release the slave from its bond */
bond_detach_slave(bond, our_slave); bond_detach_slave(bond, our_slave);
if (bond->primary_slave == our_slave) {
bond->primary_slave = NULL;
}
printk (KERN_INFO "%s: releasing %s interface %s", printk (KERN_INFO "%s: releasing %s interface %s",
master->name, master->name,
(our_slave->state == BOND_STATE_ACTIVE) ? "active" : "backup", (our_slave->state == BOND_STATE_ACTIVE) ? "active" : "backup",
...@@ -1959,10 +1963,6 @@ static int bond_release(struct net_device *master, struct net_device *slave) ...@@ -1959,10 +1963,6 @@ static int bond_release(struct net_device *master, struct net_device *slave)
master->name); master->name);
} }
if (bond->primary_slave == our_slave) {
bond->primary_slave = NULL;
}
if ((bond_mode == BOND_MODE_TLB) || if ((bond_mode == BOND_MODE_TLB) ||
(bond_mode == BOND_MODE_ALB)) { (bond_mode == BOND_MODE_ALB)) {
/* must be called only after the slave has been /* must be called only after the slave has been
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment