diff options
author | David S. Miller <davem@davemloft.net> | 2021-02-10 22:30:12 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-02-10 22:30:12 +0100 |
commit | dc9d87581d464e7b7d38853d6904b70b6c920d99 (patch) | |
tree | 15aa27fefb867814899c0a0c194adf327675ba10 /net/dsa | |
parent | Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/n... (diff) | |
parent | Merge tag 'pm-5.11-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/rafa... (diff) | |
download | linux-dc9d87581d464e7b7d38853d6904b70b6c920d99.tar.xz linux-dc9d87581d464e7b7d38853d6904b70b6c920d99.zip |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Diffstat (limited to 'net/dsa')
-rw-r--r-- | net/dsa/dsa2.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/net/dsa/dsa2.c b/net/dsa/dsa2.c index 96249c4ad5f2..4d4956ed303b 100644 --- a/net/dsa/dsa2.c +++ b/net/dsa/dsa2.c @@ -724,20 +724,23 @@ static int dsa_switch_setup(struct dsa_switch *ds) ds->slave_mii_bus = devm_mdiobus_alloc(ds->dev); if (!ds->slave_mii_bus) { err = -ENOMEM; - goto unregister_notifier; + goto teardown; } dsa_slave_mii_bus_init(ds); err = mdiobus_register(ds->slave_mii_bus); if (err < 0) - goto unregister_notifier; + goto teardown; } ds->setup = true; return 0; +teardown: + if (ds->ops->teardown) + ds->ops->teardown(ds); unregister_notifier: dsa_switch_unregister_notifier(ds); unregister_devlink_ports: |