Skip to content

Commit

Permalink
netns: restore ops before calling ops_exit_list
Browse files Browse the repository at this point in the history
ops has been iterated to first element when call pre_exit, and
it needs to restore from save_ops, not save ops to save_ops

Fixes: d7d9987 ("netns: add pre_exit method to struct pernet_operations")
Signed-off-by: Li RongQing <[email protected]>
Reviewed-by: Eric Dumazet <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
lrq-max authored and davem330 committed Jun 22, 2019
1 parent 9eee3b4 commit b272a0a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/core/net_namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ static __net_init int setup_net(struct net *net, struct user_namespace *user_ns)

synchronize_rcu();

saved_ops = ops;
ops = saved_ops;
list_for_each_entry_continue_reverse(ops, &pernet_list, list)
ops_exit_list(ops, &net_exit_list);

Expand Down

0 comments on commit b272a0a

Please sign in to comment.