diff options
author | Veaceslav Falico <vfalico@redhat.com> | 2013-09-27 09:10:58 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-09-28 18:27:33 -0400 |
commit | 746844931ed400eef32edaa069b996eb622bc39a (patch) | |
tree | d52cacdacaaf2410043fbb1425d82e8c416a9fa9 /drivers/net/bonding/bond_3ad.c | |
parent | 23c147e026bbb41dd26a2bda0404a95ea951072f (diff) |
bonding: verify if we still have slaves in bond_3ad_unbind_slave()
After commit 1f718f0f4f97145f4072d2d72dcf85069ca7226d ("bonding: populate
neighbour's private on enslave"), we've moved the unlinking of the slave
to the earliest position possible - so that nobody will see an
half-uninited slave.
However, bond_3ad_unbind_slave() relied that, even while removing the last
slave, it is still accessible - via __get_first_agg() (and, eventually,
bond_first_slave()).
Fix that by verifying if the aggregator return is an actual aggregator, but
not NULL.
CC: Jay Vosburgh <fubar@us.ibm.com>
CC: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding/bond_3ad.c')
-rw-r--r-- | drivers/net/bonding/bond_3ad.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c index 1337eafe4311..2715ea87d64c 100644 --- a/drivers/net/bonding/bond_3ad.c +++ b/drivers/net/bonding/bond_3ad.c | |||
@@ -2056,7 +2056,9 @@ void bond_3ad_unbind_slave(struct slave *slave) | |||
2056 | pr_info("%s: Removing an active aggregator\n", | 2056 | pr_info("%s: Removing an active aggregator\n", |
2057 | slave->bond->dev->name); | 2057 | slave->bond->dev->name); |
2058 | // select new active aggregator | 2058 | // select new active aggregator |
2059 | ad_agg_selection_logic(__get_first_agg(port)); | 2059 | temp_aggregator = __get_first_agg(port); |
2060 | if (temp_aggregator) | ||
2061 | ad_agg_selection_logic(temp_aggregator); | ||
2060 | } | 2062 | } |
2061 | } | 2063 | } |
2062 | } | 2064 | } |