git://ftp.safe.ca
/
safe
/
jmp
/
linux-2.6
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
crypto: api - Move type exit function into crypto_tfm
[safe/jmp/linux-2.6]
/
crypto
/
api.c
diff --git
a/crypto/api.c
b/crypto/api.c
index
0444d24
..
cbaaf34
100644
(file)
--- a/
crypto/api.c
+++ b/
crypto/api.c
@@
-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) {
const struct crypto_type *type = tfm->__crt_alg->cra_type;
if (type) {
- if (t
ype
->exit)
- t
ype
->exit(tfm);
+ if (t
fm
->exit)
+ t
fm
->exit(tfm);
return;
}
return;
}
@@
-379,17
+379,16
@@
struct crypto_tfm *__crypto_alloc_tfm(struct crypto_alg *alg, u32 type,
if (err)
goto out_free_tfm;
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 cra_init_failed;
- }
goto out;
cra_init_failed:
crypto_exit_ops(tfm);
out_free_tfm:
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);
kfree(tfm);
out_err:
tfm = ERR_PTR(err);
@@
-469,7
+468,7
@@
void crypto_free_tfm(struct crypto_tfm *tfm)
alg = tfm->__crt_alg;
size = sizeof(*tfm) + alg->cra_ctxsize;
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);
alg->cra_exit(tfm);
crypto_exit_ops(tfm);
crypto_mod_put(alg);