Run the bridge_reset_primary function only after the member being removed
has been marked as not present.
This change prevents the bridge_reset_primary function from choosing the
member being removed as the new primary member.
Signed-off-by: Alex Oprea <alex.oprea@inteno.se>
if (!bm->present)
return;
- if (bm == bst->primary_port)
- bridge_reset_primary(bst);
-
if (bst->dev.active)
bridge_disable_member(bm);
bm->present = false;
bm->bst->n_present--;
+ if (bm == bst->primary_port)
+ bridge_reset_primary(bst);
+
if (bst->config.bridge_empty)
return;