aboutsummaryrefslogtreecommitdiffstats
path: root/net/dsa
diff options
context:
space:
mode:
authorVladimir Oltean <vladimir.oltean@nxp.com>2021-10-12 15:37:35 +0300
committerJakub Kicinski <kuba@kernel.org>2021-10-13 13:36:01 -0700
commit39e222bfd7f37e7a98069869375b903d7096c113 (patch)
treeed4ec9312ba839d2f3cba88664260bfb7639f56f /net/dsa
parentmarvell: octeontx2: build error: unknown type name 'u64' (diff)
downloadlinux-dev-39e222bfd7f37e7a98069869375b903d7096c113.tar.xz
linux-dev-39e222bfd7f37e7a98069869375b903d7096c113.zip
net: dsa: unregister cross-chip notifier after ds->ops->teardown
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>
Diffstat (limited to 'net/dsa')
-rw-r--r--net/dsa/dsa2.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/dsa/dsa2.c b/net/dsa/dsa2.c
index 8ca6a1170c9d..42d9fcd3c31b 100644
--- a/net/dsa/dsa2.c
+++ b/net/dsa/dsa2.c
@@ -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)