net: dsa: fix dsa_tree_setup error path
authorVladimir Oltean <vladimir.oltean@nxp.com>
Mon, 20 Sep 2021 22:49:18 +0000 (01:49 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Sep 2021 08:12:59 +0000 (10:12 +0200)
[ Upstream commit e5845aa0eadda3d8a950eb8845c1396827131f30 ]

Since the blamed commit, dsa_tree_teardown_switches() was split into two
smaller functions, dsa_tree_teardown_switches and dsa_tree_teardown_ports.

However, the error path of dsa_tree_setup stopped calling dsa_tree_teardown_ports.

Fixes: a57d8c217aad ("net: dsa: flush switchdev workqueue before tearing down CPU/DSA ports")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/dsa/dsa2.c

index 3a8136d5915da5b1c6a064787040689d28656994..383fdc0565c746eabb75a1223ad6729b576e0d4e 100644 (file)
@@ -1001,6 +1001,7 @@ static int dsa_tree_setup(struct dsa_switch_tree *dst)
 teardown_master:
        dsa_tree_teardown_master(dst);
 teardown_switches:
+       dsa_tree_teardown_ports(dst);
        dsa_tree_teardown_switches(dst);
 teardown_default_cpu:
        dsa_tree_teardown_default_cpu(dst);