From 45c72c85122eed534dfc32b81e267af70a4b8d1b Mon Sep 17 00:00:00 2001 From: Amir Noam Date: Thu, 11 Sep 2003 06:52:58 -0400 Subject: [PATCH] [bonding 2.6] fix OOPS in bonding driver, when removing primary --- drivers/net/bonding/bond_main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index a8aa3300cb3a8..58c621e0140d5 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -1941,6 +1941,10 @@ static int bond_release(struct net_device *master, struct net_device *slave) /* 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", @@ -1959,10 +1963,6 @@ static int bond_release(struct net_device *master, struct net_device *slave) master->name); } - if (bond->primary_slave == our_slave) { - bond->primary_slave = NULL; - } - if ((bond_mode == BOND_MODE_TLB) || (bond_mode == BOND_MODE_ALB)) { /* must be called only after the slave has been -- 2.53.0