Skip to content

Commit

Permalink
netfilter: nfnetlink_queue: Unregister pernet subsys in case of init …
Browse files Browse the repository at this point in the history
…failure

Commit 3bfe049 ("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: 3bfe049 ("netfilter: nfnetlink_{log,queue}: Register pernet in first place")
Signed-off-by: Nikolay Borisov <kernel@kyup.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
  • Loading branch information
Nikolay Borisov authored and Pablo Neira Ayuso committed Dec 9, 2015
1 parent 8e66216 commit 639e077
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/netfilter/nfnetlink_queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -1419,6 +1419,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;
}
Expand Down

0 comments on commit 639e077

Please sign in to comment.