diff options
author | Steffen Klassert <steffen.klassert@secunet.com> | 2009-07-15 16:51:04 +0800 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2009-07-15 16:51:04 +0800 |
commit | 2bbf7e6fe6014baa19ef719e2412cb02efb6eb6e (patch) | |
tree | b2484b27a7ef19cba27e8642c0d64c6f75cd3164 /crypto/cryptd.c | |
parent | d9cfc13cf01725e005a80ce263fdd7b57cac9e77 (diff) | |
download | linux-crypto-2bbf7e6fe6014baa19ef719e2412cb02efb6eb6e.tar.gz linux-crypto-2bbf7e6fe6014baa19ef719e2412cb02efb6eb6e.zip |
crypto: cryptd - Fix uninitialized return value
If cryptd_alloc_instance() fails, the return value is uninitialized.
This patch fixes this by setting the return value.
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to '')
-rw-r--r-- | crypto/cryptd.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/crypto/cryptd.c b/crypto/cryptd.c index 5dabb7db..fbd26f9d 100644 --- a/crypto/cryptd.c +++ b/crypto/cryptd.c @@ -303,6 +303,7 @@ static int cryptd_create_blkcipher(struct crypto_template *tmpl, return PTR_ERR(alg); inst = cryptd_alloc_instance(alg, 0, sizeof(*ctx)); + err = PTR_ERR(inst); if (IS_ERR(inst)) goto out_put_alg; @@ -522,6 +523,7 @@ static int cryptd_create_hash(struct crypto_template *tmpl, struct rtattr **tb, alg = &salg->base; inst = cryptd_alloc_instance(alg, ahash_instance_headroom(), sizeof(*ctx)); + err = PTR_ERR(inst); if (IS_ERR(inst)) goto out_put_alg; |