Skip to content

Commit

Permalink
net: dsa: unregister cross-chip notifier after ds->ops->teardown
Browse files Browse the repository at this point in the history
To be symmetric with the error unwind path of dsa_switch_setup(), call
dsa_switch_unregister_notifier() after ds->ops->teardown.

The implication is that ds->ops->teardown cannot emit cross-chip
notifiers. For example, currently the dsa_tag_8021q_unregister() call
from sja1105_teardown() does not propagate to the entire tree due to
this reason. However I cannot find an actual issue caused by this,
observed using code inspection.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Link: https://lore.kernel.org/r/20211012123735.2545742-1-vladimir.oltean@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Vladimir Oltean authored and Jakub Kicinski committed Oct 13, 2021
1 parent 6312d52 commit 39e222b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/dsa/dsa2.c
Original file line number Diff line number Diff line change
Expand Up @@ -924,11 +924,11 @@ static void dsa_switch_teardown(struct dsa_switch *ds)
ds->slave_mii_bus = NULL;
}

dsa_switch_unregister_notifier(ds);

if (ds->ops->teardown)
ds->ops->teardown(ds);

dsa_switch_unregister_notifier(ds);

if (ds->devlink) {
list_for_each_entry(dp, &ds->dst->ports, list)
if (dp->ds == ds)
Expand Down

0 comments on commit 39e222b

Please sign in to comment.