diff options
Diffstat (limited to 'net/xfrm')
-rw-r--r-- | net/xfrm/xfrm_ipcomp.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/net/xfrm/xfrm_ipcomp.c b/net/xfrm/xfrm_ipcomp.c index e5246fbe36c4..2906d520eea7 100644 --- a/net/xfrm/xfrm_ipcomp.c +++ b/net/xfrm/xfrm_ipcomp.c | |||
@@ -276,18 +276,16 @@ static struct crypto_comp * __percpu *ipcomp_alloc_tfms(const char *alg_name) | |||
276 | struct crypto_comp * __percpu *tfms; | 276 | struct crypto_comp * __percpu *tfms; |
277 | int cpu; | 277 | int cpu; |
278 | 278 | ||
279 | /* This can be any valid CPU ID so we don't need locking. */ | ||
280 | cpu = raw_smp_processor_id(); | ||
281 | 279 | ||
282 | list_for_each_entry(pos, &ipcomp_tfms_list, list) { | 280 | list_for_each_entry(pos, &ipcomp_tfms_list, list) { |
283 | struct crypto_comp *tfm; | 281 | struct crypto_comp *tfm; |
284 | 282 | ||
285 | tfms = pos->tfms; | 283 | /* This can be any valid CPU ID so we don't need locking. */ |
286 | tfm = *per_cpu_ptr(tfms, cpu); | 284 | tfm = __this_cpu_read(*pos->tfms); |
287 | 285 | ||
288 | if (!strcmp(crypto_comp_name(tfm), alg_name)) { | 286 | if (!strcmp(crypto_comp_name(tfm), alg_name)) { |
289 | pos->users++; | 287 | pos->users++; |
290 | return tfms; | 288 | return pos->tfms; |
291 | } | 289 | } |
292 | } | 290 | } |
293 | 291 | ||