From: Johannes Berg Date: Wed, 16 Mar 2016 13:29:08 +0000 (+0100) Subject: wext: unregister_pernet_subsys() on notifier registration failure X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=98bd147d7903580ca5d5dfa0bc39c2d16714d84e;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Johannes Berg --- 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);