Skip to content

Commit b272a0a

Browse files
lrq-maxdavem330
authored andcommitted
netns: restore ops before calling ops_exit_list
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]>
1 parent 9eee3b4 commit b272a0a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/core/net_namespace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ static __net_init int setup_net(struct net *net, struct user_namespace *user_ns)
345345

346346
synchronize_rcu();
347347

348-
saved_ops = ops;
348+
ops = saved_ops;
349349
list_for_each_entry_continue_reverse(ops, &pernet_list, list)
350350
ops_exit_list(ops, &net_exit_list);
351351

0 commit comments

Comments
 (0)