diff options
Diffstat (limited to 'net/xfrm/xfrm_policy.c')
-rw-r--r-- | net/xfrm/xfrm_policy.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index cfceb6616ec1..2c5d93181f13 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c | |||
@@ -771,8 +771,7 @@ xfrm_policy_flush_secctx_check(struct net *net, u8 type, struct xfrm_audit *audi | |||
771 | 771 | ||
772 | int xfrm_policy_flush(struct net *net, u8 type, struct xfrm_audit *audit_info) | 772 | int xfrm_policy_flush(struct net *net, u8 type, struct xfrm_audit *audit_info) |
773 | { | 773 | { |
774 | int dir, err = 0, cnt = 0; | 774 | int dir, err = 0; |
775 | struct xfrm_policy *dp; | ||
776 | 775 | ||
777 | write_lock_bh(&xfrm_policy_lock); | 776 | write_lock_bh(&xfrm_policy_lock); |
778 | 777 | ||
@@ -790,10 +789,8 @@ int xfrm_policy_flush(struct net *net, u8 type, struct xfrm_audit *audit_info) | |||
790 | &net->xfrm.policy_inexact[dir], bydst) { | 789 | &net->xfrm.policy_inexact[dir], bydst) { |
791 | if (pol->type != type) | 790 | if (pol->type != type) |
792 | continue; | 791 | continue; |
793 | dp = __xfrm_policy_unlink(pol, dir); | 792 | __xfrm_policy_unlink(pol, dir); |
794 | write_unlock_bh(&xfrm_policy_lock); | 793 | write_unlock_bh(&xfrm_policy_lock); |
795 | if (dp) | ||
796 | cnt++; | ||
797 | 794 | ||
798 | xfrm_audit_policy_delete(pol, 1, audit_info->loginuid, | 795 | xfrm_audit_policy_delete(pol, 1, audit_info->loginuid, |
799 | audit_info->sessionid, | 796 | audit_info->sessionid, |
@@ -812,10 +809,8 @@ int xfrm_policy_flush(struct net *net, u8 type, struct xfrm_audit *audit_info) | |||
812 | bydst) { | 809 | bydst) { |
813 | if (pol->type != type) | 810 | if (pol->type != type) |
814 | continue; | 811 | continue; |
815 | dp = __xfrm_policy_unlink(pol, dir); | 812 | __xfrm_policy_unlink(pol, dir); |
816 | write_unlock_bh(&xfrm_policy_lock); | 813 | write_unlock_bh(&xfrm_policy_lock); |
817 | if (dp) | ||
818 | cnt++; | ||
819 | 814 | ||
820 | xfrm_audit_policy_delete(pol, 1, | 815 | xfrm_audit_policy_delete(pol, 1, |
821 | audit_info->loginuid, | 816 | audit_info->loginuid, |
@@ -829,8 +824,6 @@ int xfrm_policy_flush(struct net *net, u8 type, struct xfrm_audit *audit_info) | |||
829 | } | 824 | } |
830 | 825 | ||
831 | } | 826 | } |
832 | if (!cnt) | ||
833 | err = -ESRCH; | ||
834 | atomic_inc(&flow_cache_genid); | 827 | atomic_inc(&flow_cache_genid); |
835 | out: | 828 | out: |
836 | write_unlock_bh(&xfrm_policy_lock); | 829 | write_unlock_bh(&xfrm_policy_lock); |