Commit 74684493 authored by Veaceslav Falico's avatar Veaceslav Falico Committed by David S. Miller

bonding: verify if we still have slaves in bond_3ad_unbind_slave()

After commit 1f718f0f ("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: default avatarVeaceslav Falico <vfalico@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 23c147e0
...@@ -2056,7 +2056,9 @@ void bond_3ad_unbind_slave(struct slave *slave) ...@@ -2056,7 +2056,9 @@ void bond_3ad_unbind_slave(struct slave *slave)
pr_info("%s: Removing an active aggregator\n", pr_info("%s: Removing an active aggregator\n",
slave->bond->dev->name); slave->bond->dev->name);
// select new active aggregator // select new active aggregator
ad_agg_selection_logic(__get_first_agg(port)); temp_aggregator = __get_first_agg(port);
if (temp_aggregator)
ad_agg_selection_logic(temp_aggregator);
} }
} }
} }
......
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