Skip to content

Commit

Permalink
fib_rules: exit_net cleanup check added
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
vaverin authored and davem330 committed Nov 14, 2017
1 parent 0b6f595 commit ce2b7db
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions net/core/fib_rules.c
Expand Up @@ -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)
Expand Down

0 comments on commit ce2b7db

Please sign in to comment.