Skip to content

Commit ce2b7db

Browse files
vaverindavem330
authored andcommitted
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 0b6f595 commit ce2b7db

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

net/core/fib_rules.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,8 +1022,14 @@ static int __net_init fib_rules_net_init(struct net *net)
10221022
return 0;
10231023
}
10241024

1025+
static void __net_exit fib_rules_net_exit(struct net *net)
1026+
{
1027+
WARN_ON_ONCE(!list_empty(&net->rules_ops));
1028+
}
1029+
10251030
static struct pernet_operations fib_rules_net_ops = {
10261031
.init = fib_rules_net_init,
1032+
.exit = fib_rules_net_exit,
10271033
};
10281034

10291035
static int __init fib_rules_init(void)

0 commit comments

Comments
 (0)