diff options
Diffstat (limited to 'net/key/af_key.c')
-rw-r--r-- | net/key/af_key.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/net/key/af_key.c b/net/key/af_key.c index 4744b1f6372f..e2aacf0ba013 100644 --- a/net/key/af_key.c +++ b/net/key/af_key.c | |||
@@ -3019,12 +3019,11 @@ static int pfkey_send_policy_notify(struct xfrm_policy *xp, int dir, struct km_e | |||
3019 | static u32 get_acqseq(void) | 3019 | static u32 get_acqseq(void) |
3020 | { | 3020 | { |
3021 | u32 res; | 3021 | u32 res; |
3022 | static u32 acqseq; | 3022 | static atomic_t acqseq; |
3023 | static DEFINE_SPINLOCK(acqseq_lock); | ||
3024 | 3023 | ||
3025 | spin_lock_bh(&acqseq_lock); | 3024 | do { |
3026 | res = (++acqseq ? : ++acqseq); | 3025 | res = atomic_inc_return(&acqseq); |
3027 | spin_unlock_bh(&acqseq_lock); | 3026 | } while (!res); |
3028 | return res; | 3027 | return res; |
3029 | } | 3028 | } |
3030 | 3029 | ||