aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/xfrm/xfrm_policy.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index 2ef6db98e9ba..bc5eae12fb09 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -975,8 +975,6 @@ int xfrm_policy_flush(struct net *net, u8 type, bool task_valid)
975 } 975 }
976 if (!cnt) 976 if (!cnt)
977 err = -ESRCH; 977 err = -ESRCH;
978 else
979 xfrm_policy_cache_flush();
980out: 978out:
981 spin_unlock_bh(&net->xfrm.xfrm_policy_lock); 979 spin_unlock_bh(&net->xfrm.xfrm_policy_lock);
982 return err; 980 return err;
@@ -1744,6 +1742,8 @@ void xfrm_policy_cache_flush(void)
1744 bool found = 0; 1742 bool found = 0;
1745 int cpu; 1743 int cpu;
1746 1744
1745 might_sleep();
1746
1747 local_bh_disable(); 1747 local_bh_disable();
1748 rcu_read_lock(); 1748 rcu_read_lock();
1749 for_each_possible_cpu(cpu) { 1749 for_each_possible_cpu(cpu) {