diff options
-rw-r--r-- | net/dsa/dsa.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c index 36de4f2a3366..cb080efdc7b3 100644 --- a/net/dsa/dsa.c +++ b/net/dsa/dsa.c @@ -344,15 +344,22 @@ static int __init dsa_init_module(void) rc = dsa_slave_register_notifier(); if (rc) - return rc; + goto register_notifier_fail; rc = dsa_legacy_register(); if (rc) - return rc; + goto legacy_register_fail; dev_add_pack(&dsa_pack_type); return 0; + +legacy_register_fail: + dsa_slave_unregister_notifier(); +register_notifier_fail: + destroy_workqueue(dsa_owq); + + return rc; } module_init(dsa_init_module); |