diff options
author | Eric Biggers <ebiggers@google.com> | 2020-01-02 19:59:00 -0800 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2020-01-09 11:30:56 +0800 |
commit | aacd5b4cfb87306888eb9e3612cb90afbb2ecba5 (patch) | |
tree | 1929494b9df06b228d8ab8d9dc8cda32100961e0 /include/crypto | |
parent | c282586fc341f9af741928f74a90163d26a1b347 (diff) | |
download | lwn-aacd5b4cfb87306888eb9e3612cb90afbb2ecba5.tar.gz lwn-aacd5b4cfb87306888eb9e3612cb90afbb2ecba5.zip |
crypto: skcipher - use crypto_grab_cipher() and simplify error paths
Make skcipher_alloc_instance_simple() use the new function
crypto_grab_cipher() to initialize its cipher spawn.
This is needed to make all spawns be initialized in a consistent way.
Also simplify the error handling by taking advantage of crypto_drop_*()
now accepting (as a no-op) spawns that haven't been initialized yet, and
by taking advantage of crypto_grab_*() now handling ERR_PTR() names.
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include/crypto')
-rw-r--r-- | include/crypto/internal/skcipher.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/crypto/internal/skcipher.h b/include/crypto/internal/skcipher.h index e387424f6247..10226c12c5df 100644 --- a/include/crypto/internal/skcipher.h +++ b/include/crypto/internal/skcipher.h @@ -214,9 +214,9 @@ struct skcipher_instance *skcipher_alloc_instance_simple( static inline struct crypto_alg *skcipher_ialg_simple( struct skcipher_instance *inst) { - struct crypto_spawn *spawn = skcipher_instance_ctx(inst); + struct crypto_cipher_spawn *spawn = skcipher_instance_ctx(inst); - return spawn->alg; + return crypto_spawn_cipher_alg(spawn); } #endif /* _CRYPTO_INTERNAL_SKCIPHER_H */ |