fib_rules: exit_net cleanup check added

Be sure that rules_ops list initialized in net_init hook was return
to initial state.

Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Vasily Averin 2017-11-12 22:30:01 +03:00 committed by David S. Miller
parent 0b6f595535
commit ce2b7db38a
1 changed files with 6 additions and 0 deletions

View File

@ -1022,8 +1022,14 @@ static int __net_init fib_rules_net_init(struct net *net)
return 0;
}
static void __net_exit fib_rules_net_exit(struct net *net)
{
WARN_ON_ONCE(!list_empty(&net->rules_ops));
}
static struct pernet_operations fib_rules_net_ops = {
.init = fib_rules_net_init,
.exit = fib_rules_net_exit,
};
static int __init fib_rules_init(void)