Commit 11c9a7d3 authored by YueHaibing's avatar YueHaibing Committed by Jakub Kicinski

act_mirred: Fix mirred_init_module error handling

If tcf_register_action failed, mirred_device_notifier
should be unregistered.

Fixes: 3b87956e ("net sched: fix race in mirred device removal")
Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
parent a954380a
...@@ -484,7 +484,11 @@ static int __init mirred_init_module(void) ...@@ -484,7 +484,11 @@ static int __init mirred_init_module(void)
return err; return err;
pr_info("Mirror/redirect action on\n"); 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) static void __exit mirred_cleanup_module(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment