summaryrefslogtreecommitdiffstats
path: root/net/dsa
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2022-03-23 18:52:56 +0100
committerJakub Kicinski <kuba@kernel.org>2022-03-23 18:53:49 +0100
commit89695196f0ba78a17453f9616355f2ca6b293402 (patch)
tree7a0f44d06e5b83002899667841baa9a3598bf819 /net/dsa
parentllc: fix netdevice reference leaks in llc_ui_bind() (diff)
parentMerge branch 'ice-avoid-sleeping-scheduling-in-atomic-contexts' (diff)
downloadlinux-89695196f0ba78a17453f9616355f2ca6b293402.tar.xz
linux-89695196f0ba78a17453f9616355f2ca6b293402.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Merge in overtime fixes, no conflicts. Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/dsa')
-rw-r--r--net/dsa/dsa2.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/dsa/dsa2.c b/net/dsa/dsa2.c
index 47b334226f4e..ca6af86964bc 100644
--- a/net/dsa/dsa2.c
+++ b/net/dsa/dsa2.c
@@ -1786,6 +1786,10 @@ void dsa_switch_shutdown(struct dsa_switch *ds)
struct dsa_port *dp;
mutex_lock(&dsa2_mutex);
+
+ if (!ds->setup)
+ goto out;
+
rtnl_lock();
dsa_switch_for_each_user_port(dp, ds) {
@@ -1802,6 +1806,7 @@ void dsa_switch_shutdown(struct dsa_switch *ds)
dp->master->dsa_ptr = NULL;
rtnl_unlock();
+out:
mutex_unlock(&dsa2_mutex);
}
EXPORT_SYMBOL_GPL(dsa_switch_shutdown);