Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 120594
b: refs/heads/master
c: 4a77948
h: refs/heads/master
v: v3
  • Loading branch information
Herbert Xu committed Dec 25, 2008
1 parent c8f3fe5 commit 77219e5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2566578a6feb9d9e39da41326afe8ed6022db3c5
refs/heads/master: 4a7794860ba2b56693b1d89fd485fd08cdc763e3
13 changes: 6 additions & 7 deletions trunk/crypto/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,8 @@ static void crypto_exit_ops(struct crypto_tfm *tfm)
const struct crypto_type *type = tfm->__crt_alg->cra_type;

if (type) {
if (type->exit)
type->exit(tfm);
if (tfm->exit)
tfm->exit(tfm);
return;
}

Expand Down Expand Up @@ -379,17 +379,16 @@ struct crypto_tfm *__crypto_alloc_tfm(struct crypto_alg *alg, u32 type,
if (err)
goto out_free_tfm;

if (alg->cra_init && (err = alg->cra_init(tfm))) {
if (err == -EAGAIN)
crypto_shoot_alg(alg);
if (!tfm->exit && alg->cra_init && (err = alg->cra_init(tfm)))
goto cra_init_failed;
}

goto out;

cra_init_failed:
crypto_exit_ops(tfm);
out_free_tfm:
if (err == -EAGAIN)
crypto_shoot_alg(alg);
kfree(tfm);
out_err:
tfm = ERR_PTR(err);
Expand Down Expand Up @@ -469,7 +468,7 @@ void crypto_free_tfm(struct crypto_tfm *tfm)
alg = tfm->__crt_alg;
size = sizeof(*tfm) + alg->cra_ctxsize;

if (alg->cra_exit)
if (!tfm->exit && alg->cra_exit)
alg->cra_exit(tfm);
crypto_exit_ops(tfm);
crypto_mod_put(alg);
Expand Down
1 change: 0 additions & 1 deletion trunk/include/crypto/algapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ struct seq_file;
struct crypto_type {
unsigned int (*ctxsize)(struct crypto_alg *alg, u32 type, u32 mask);
int (*init)(struct crypto_tfm *tfm, u32 type, u32 mask);
void (*exit)(struct crypto_tfm *tfm);
void (*show)(struct seq_file *m, struct crypto_alg *alg);
};

Expand Down
2 changes: 2 additions & 0 deletions trunk/include/linux/crypto.h
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,8 @@ struct crypto_tfm {
struct compress_tfm compress;
struct rng_tfm rng;
} crt_u;

void (*exit)(struct crypto_tfm *tfm);

struct crypto_alg *__crt_alg;

Expand Down

0 comments on commit 77219e5

Please sign in to comment.