diff options
author | YueHaibing <yuehaibing@huawei.com> | 2019-10-09 05:10:52 +0200 |
---|---|---|
committer | Jakub Kicinski <jakub.kicinski@netronome.com> | 2019-10-10 04:19:35 +0200 |
commit | 11c9a7d38af524217efb7a176ad322b97ac2f163 (patch) | |
tree | 3445fbbdb8548340c11d31f747f697c32bfc3666 /net/sched/act_mirred.c | |
parent | net: taprio: Fix returning EINVAL when configuring without flags (diff) | |
download | linux-11c9a7d38af524217efb7a176ad322b97ac2f163.tar.xz linux-11c9a7d38af524217efb7a176ad322b97ac2f163.zip |
act_mirred: Fix mirred_init_module error handling
If tcf_register_action failed, mirred_device_notifier
should be unregistered.
Fixes: 3b87956ea645 ("net sched: fix race in mirred device removal")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Diffstat (limited to 'net/sched/act_mirred.c')
-rw-r--r-- | net/sched/act_mirred.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c index 9ce073a05414..08923b21e566 100644 --- a/net/sched/act_mirred.c +++ b/net/sched/act_mirred.c @@ -484,7 +484,11 @@ static int __init mirred_init_module(void) return err; pr_info("Mirror/redirect action on\n"); - return tcf_register_action(&act_mirred_ops, &mirred_net_ops); + err = tcf_register_action(&act_mirred_ops, &mirred_net_ops); + if (err) + unregister_netdevice_notifier(&mirred_device_notifier); + + return err; } static void __exit mirred_cleanup_module(void) |