Skip to content

Commit

Permalink
fib_notifier: exit_net cleanup check added
Browse files Browse the repository at this point in the history
Be sure that fib_notifier_ops list initilized 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
Vasily Averin authored and David S. Miller committed Nov 14, 2017
1 parent ee21b18 commit 0b6f595
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions net/core/fib_notifier.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,14 @@ static int __net_init fib_notifier_net_init(struct net *net)
return 0;
}

static void __net_exit fib_notifier_net_exit(struct net *net)
{
WARN_ON_ONCE(!list_empty(&net->fib_notifier_ops));
}

static struct pernet_operations fib_notifier_net_ops = {
.init = fib_notifier_net_init,
.exit = fib_notifier_net_exit,
};

static int __init fib_notifier_init(void)
Expand Down

0 comments on commit 0b6f595

Please sign in to comment.