diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2009-02-18 16:56:59 +0800 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2009-02-18 16:56:59 +0800 |
commit | 3f683d6175748ef9daf4698d9ef5a488dd037063 (patch) | |
tree | 1cea62b5937871b34c533416e05bedbee4a4914c /include/linux/crypto.h | |
parent | ff753308d2f70f210ba468492cd9a01274d9d7ce (diff) | |
download | linux-stable-3f683d6175748ef9daf4698d9ef5a488dd037063.tar.gz linux-stable-3f683d6175748ef9daf4698d9ef5a488dd037063.tar.bz2 linux-stable-3f683d6175748ef9daf4698d9ef5a488dd037063.zip |
crypto: api - Fix crypto_alloc_tfm/create_create_tfm return convention
This is based on a report and patch by Geert Uytterhoeven.
The functions crypto_alloc_tfm and create_create_tfm return a
pointer that needs to be adjusted by the caller when successful
and otherwise an error value. This means that the caller has
to check for the error and only perform the adjustment if the
pointer returned is valid.
Since all callers want to make the adjustment and we know how
to adjust it ourselves, it's much easier to just return adjusted
pointer directly.
The only caveat is that we have to return a void * instead of
struct crypto_tfm *. However, this isn't that bad because both
of these functions are for internal use only (by types code like
shash.c, not even algorithms code).
This patch also moves crypto_alloc_tfm into crypto/internal.h
(crypto_create_tfm is already there) to reflect this.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include/linux/crypto.h')
-rw-r--r-- | include/linux/crypto.h | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/include/linux/crypto.h b/include/linux/crypto.h index 1f2e9020acc6..29729b834380 100644 --- a/include/linux/crypto.h +++ b/include/linux/crypto.h @@ -548,9 +548,6 @@ struct crypto_attr_u32 { * Transform user interface. */ -struct crypto_tfm *crypto_alloc_tfm(const char *alg_name, - const struct crypto_type *frontend, - u32 type, u32 mask); struct crypto_tfm *crypto_alloc_base(const char *alg_name, u32 type, u32 mask); void crypto_destroy_tfm(void *mem, struct crypto_tfm *tfm); |