diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-02-13 03:44:22 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-02-13 03:44:22 -0500 |
commit | f8a6b2b9cee298a9663cbe38ce1eb5240987cb62 (patch) | |
tree | b356490269c9e77d164dcc1477792b882fbb8bdb /crypto/api.c | |
parent | ba1511bf7fbda452138e4096bf10d5a382710f4f (diff) | |
parent | 071a0bc2ceace31266836801510879407a3701fa (diff) |
Merge branch 'linus' into x86/apic
Conflicts:
arch/x86/kernel/acpi/boot.c
arch/x86/mm/fault.c
Diffstat (limited to 'crypto/api.c')
-rw-r--r-- | crypto/api.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/crypto/api.c b/crypto/api.c index 9975a7bd246c..efe77df6863f 100644 --- a/crypto/api.c +++ b/crypto/api.c | |||
@@ -557,34 +557,34 @@ err: | |||
557 | return ERR_PTR(err); | 557 | return ERR_PTR(err); |
558 | } | 558 | } |
559 | EXPORT_SYMBOL_GPL(crypto_alloc_tfm); | 559 | EXPORT_SYMBOL_GPL(crypto_alloc_tfm); |
560 | 560 | ||
561 | /* | 561 | /* |
562 | * crypto_free_tfm - Free crypto transform | 562 | * crypto_destroy_tfm - Free crypto transform |
563 | * @mem: Start of tfm slab | ||
563 | * @tfm: Transform to free | 564 | * @tfm: Transform to free |
564 | * | 565 | * |
565 | * crypto_free_tfm() frees up the transform and any associated resources, | 566 | * This function frees up the transform and any associated resources, |
566 | * then drops the refcount on the associated algorithm. | 567 | * then drops the refcount on the associated algorithm. |
567 | */ | 568 | */ |
568 | void crypto_free_tfm(struct crypto_tfm *tfm) | 569 | void crypto_destroy_tfm(void *mem, struct crypto_tfm *tfm) |
569 | { | 570 | { |
570 | struct crypto_alg *alg; | 571 | struct crypto_alg *alg; |
571 | int size; | 572 | int size; |
572 | 573 | ||
573 | if (unlikely(!tfm)) | 574 | if (unlikely(!mem)) |
574 | return; | 575 | return; |
575 | 576 | ||
576 | alg = tfm->__crt_alg; | 577 | alg = tfm->__crt_alg; |
577 | size = sizeof(*tfm) + alg->cra_ctxsize; | 578 | size = ksize(mem); |
578 | 579 | ||
579 | if (!tfm->exit && alg->cra_exit) | 580 | if (!tfm->exit && alg->cra_exit) |
580 | alg->cra_exit(tfm); | 581 | alg->cra_exit(tfm); |
581 | crypto_exit_ops(tfm); | 582 | crypto_exit_ops(tfm); |
582 | crypto_mod_put(alg); | 583 | crypto_mod_put(alg); |
583 | memset(tfm, 0, size); | 584 | memset(mem, 0, size); |
584 | kfree(tfm); | 585 | kfree(mem); |
585 | } | 586 | } |
586 | 587 | EXPORT_SYMBOL_GPL(crypto_destroy_tfm); | |
587 | EXPORT_SYMBOL_GPL(crypto_free_tfm); | ||
588 | 588 | ||
589 | int crypto_has_alg(const char *name, u32 type, u32 mask) | 589 | int crypto_has_alg(const char *name, u32 type, u32 mask) |
590 | { | 590 | { |