mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-03 09:04:21 +08:00
wext: unregister_pernet_subsys() on notifier registration failure
If register_netdevice_notifier() fails (which in practice it can't right now), we should call unregister_pernet_subsys(). Do that. Reported-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
05cf8077e5
commit
98bd147d79
@ -399,7 +399,10 @@ static int __init wireless_nlevent_init(void)
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
return register_netdevice_notifier(&wext_netdev_notifier);
|
||||
err = register_netdevice_notifier(&wext_netdev_notifier);
|
||||
if (err)
|
||||
unregister_pernet_subsys(&wext_pernet_ops);
|
||||
return err;
|
||||
}
|
||||
|
||||
subsys_initcall(wireless_nlevent_init);
|
||||
|
Loading…
Reference in New Issue
Block a user