From: Li RongQing Date: Thu, 20 Jun 2019 11:24:40 +0000 (+0800) Subject: netns: restore ops before calling ops_exit_list X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=b272a0ad730103e84fb735fd0a8cc050cdf7f77c;p=linux.git 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: d7d99872c144 ("netns: add pre_exit method to struct pernet_operations") Signed-off-by: Li RongQing Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller --- diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c index 89dc99a28978f..198ce503ae73d 100644 --- a/net/core/net_namespace.c +++ b/net/core/net_namespace.c @@ -345,7 +345,7 @@ out_undo: 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);