We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aafd0d8 commit f7c83bcCopy full SHA for f7c83bc
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;
277
int cpu;
278
279
- /* This can be any valid CPU ID so we don't need locking. */
280
- cpu = raw_smp_processor_id();
281
282
list_for_each_entry(pos, &ipcomp_tfms_list, list) {
283
struct crypto_comp *tfm;
284
285
- tfms = pos->tfms;
286
- tfm = *per_cpu_ptr(tfms, cpu);
+ /* This can be any valid CPU ID so we don't need locking. */
+ tfm = __this_cpu_read(*pos->tfms);
287
288
if (!strcmp(crypto_comp_name(tfm), alg_name)) {
289
pos->users++;
290
- return tfms;
+ return pos->tfms;
291
}
292
293
0 commit comments