ipcomp6.c (12df7556705aae97f24a397377e17898700d7192) ipcomp6.c (6f912042256c12b0927438122594f5379b364f5d)
1/*
2 * IP Payload Compression Protocol (IPComp) for IPv6 - RFC3173
3 *
4 * Copyright (C)2003 USAGI/WIDE Project
5 *
6 * Author Mitsuru KANDA <mk@linux-ipv6.org>
7 *
8 * This program is free software; you can redistribute it and/or modify

--- 276 unchanged lines hidden (view full) ---

285
286 if (--ipcomp6_scratch_users)
287 return;
288
289 scratches = ipcomp6_scratches;
290 if (!scratches)
291 return;
292
1/*
2 * IP Payload Compression Protocol (IPComp) for IPv6 - RFC3173
3 *
4 * Copyright (C)2003 USAGI/WIDE Project
5 *
6 * Author Mitsuru KANDA <mk@linux-ipv6.org>
7 *
8 * This program is free software; you can redistribute it and/or modify

--- 276 unchanged lines hidden (view full) ---

285
286 if (--ipcomp6_scratch_users)
287 return;
288
289 scratches = ipcomp6_scratches;
290 if (!scratches)
291 return;
292
293 for_each_cpu(i) {
293 for_each_possible_cpu(i) {
294 void *scratch = *per_cpu_ptr(scratches, i);
295
296 vfree(scratch);
297 }
298
299 free_percpu(scratches);
300}
301

--- 6 unchanged lines hidden (view full) ---

308 return ipcomp6_scratches;
309
310 scratches = alloc_percpu(void *);
311 if (!scratches)
312 return NULL;
313
314 ipcomp6_scratches = scratches;
315
294 void *scratch = *per_cpu_ptr(scratches, i);
295
296 vfree(scratch);
297 }
298
299 free_percpu(scratches);
300}
301

--- 6 unchanged lines hidden (view full) ---

308 return ipcomp6_scratches;
309
310 scratches = alloc_percpu(void *);
311 if (!scratches)
312 return NULL;
313
314 ipcomp6_scratches = scratches;
315
316 for_each_cpu(i) {
316 for_each_possible_cpu(i) {
317 void *scratch = vmalloc(IPCOMP_SCRATCH_SIZE);
318 if (!scratch)
319 return NULL;
320 *per_cpu_ptr(scratches, i) = scratch;
321 }
322
323 return scratches;
324}

--- 14 unchanged lines hidden (view full) ---

339 return;
340
341 list_del(&pos->list);
342 kfree(pos);
343
344 if (!tfms)
345 return;
346
317 void *scratch = vmalloc(IPCOMP_SCRATCH_SIZE);
318 if (!scratch)
319 return NULL;
320 *per_cpu_ptr(scratches, i) = scratch;
321 }
322
323 return scratches;
324}

--- 14 unchanged lines hidden (view full) ---

339 return;
340
341 list_del(&pos->list);
342 kfree(pos);
343
344 if (!tfms)
345 return;
346
347 for_each_cpu(cpu) {
347 for_each_possible_cpu(cpu) {
348 struct crypto_tfm *tfm = *per_cpu_ptr(tfms, cpu);
349 crypto_free_tfm(tfm);
350 }
351 free_percpu(tfms);
352}
353
354static struct crypto_tfm **ipcomp6_alloc_tfms(const char *alg_name)
355{

--- 23 unchanged lines hidden (view full) ---

379 pos->users = 1;
380 INIT_LIST_HEAD(&pos->list);
381 list_add(&pos->list, &ipcomp6_tfms_list);
382
383 pos->tfms = tfms = alloc_percpu(struct crypto_tfm *);
384 if (!tfms)
385 goto error;
386
348 struct crypto_tfm *tfm = *per_cpu_ptr(tfms, cpu);
349 crypto_free_tfm(tfm);
350 }
351 free_percpu(tfms);
352}
353
354static struct crypto_tfm **ipcomp6_alloc_tfms(const char *alg_name)
355{

--- 23 unchanged lines hidden (view full) ---

379 pos->users = 1;
380 INIT_LIST_HEAD(&pos->list);
381 list_add(&pos->list, &ipcomp6_tfms_list);
382
383 pos->tfms = tfms = alloc_percpu(struct crypto_tfm *);
384 if (!tfms)
385 goto error;
386
387 for_each_cpu(cpu) {
387 for_each_possible_cpu(cpu) {
388 struct crypto_tfm *tfm = crypto_alloc_tfm(alg_name, 0);
389 if (!tfm)
390 goto error;
391 *per_cpu_ptr(tfms, cpu) = tfm;
392 }
393
394 return tfms;
395

--- 127 unchanged lines hidden ---
388 struct crypto_tfm *tfm = crypto_alloc_tfm(alg_name, 0);
389 if (!tfm)
390 goto error;
391 *per_cpu_ptr(tfms, cpu) = tfm;
392 }
393
394 return tfms;
395

--- 127 unchanged lines hidden ---