diff options
author | Johannes Berg <johannes.berg@intel.com> | 2016-03-16 16:29:08 +0300 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2016-04-05 11:48:44 +0300 |
commit | 98bd147d7903580ca5d5dfa0bc39c2d16714d84e (patch) | |
tree | 665ab939fa6de287c4a70ca1e087d8a920f734b7 /net/wireless/wext-core.c | |
parent | 05cf8077e54b20dddb756eaa26f3aeb5c38dd3cf (diff) | |
download | linux-98bd147d7903580ca5d5dfa0bc39c2d16714d84e.tar.xz |
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>
Diffstat (limited to 'net/wireless/wext-core.c')
-rw-r--r-- | net/wireless/wext-core.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/net/wireless/wext-core.c b/net/wireless/wext-core.c index b50ee5d622e1..6250b1cfcde5 100644 --- a/net/wireless/wext-core.c +++ b/net/wireless/wext-core.c @@ -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); |