Commit fdff6970 authored by Nikolay Borisov's avatar Nikolay Borisov Committed by Kamal Mostafa

netfilter: nfnetlink_queue: Unregister pernet subsys in case of init failure

commit 639e077b upstream.

Commit 3bfe0498 ("netfilter: nfnetlink_{log,queue}:
Register pernet in first place") reorganised the initialisation
order of the pernet_subsys to avoid "use-before-initialised"
condition. However, in doing so the cleanup logic in nfnetlink_queue
got botched in that the pernet_subsys wasn't cleaned in case
nfnetlink_subsys_register failed. This patch adds the necessary
cleanup routine call.

Fixes: 3bfe0498 ("netfilter: nfnetlink_{log,queue}: Register pernet in first place")
Signed-off-by: default avatarNikolay Borisov <kernel@kyup.com>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
[ kamal: backport to 4.2-stable: appled to nfnetlink_queue_core.c ]
Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
parent 69b4bf8b
......@@ -1392,6 +1392,7 @@ static int __init nfnetlink_queue_init(void)
cleanup_netlink_notifier:
netlink_unregister_notifier(&nfqnl_rtnl_notifier);
unregister_pernet_subsys(&nfnl_queue_net_ops);
out:
return status;
}
......
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