diff options
author | Steffen Klassert <steffen.klassert@secunet.com> | 2009-07-15 04:51:04 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2009-07-15 04:51:04 -0400 |
commit | 05ed8758fa30e088766905d0d600aa393e144353 (patch) | |
tree | a9d239f358197e0109c7be9701382831cecd241a /crypto | |
parent | 305f9db22d62da10c43c7fd7554ec923c2b8727e (diff) |
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 'crypto')
-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 5dabb7dbad84..fbd26f9dd329 100644 --- a/crypto/cryptd.c +++ b/crypto/cryptd.c | |||
@@ -303,6 +303,7 @@ static int cryptd_create_blkcipher(struct crypto_template *tmpl, | |||
303 | return PTR_ERR(alg); | 303 | return PTR_ERR(alg); |
304 | 304 | ||
305 | inst = cryptd_alloc_instance(alg, 0, sizeof(*ctx)); | 305 | inst = cryptd_alloc_instance(alg, 0, sizeof(*ctx)); |
306 | err = PTR_ERR(inst); | ||
306 | if (IS_ERR(inst)) | 307 | if (IS_ERR(inst)) |
307 | goto out_put_alg; | 308 | goto out_put_alg; |
308 | 309 | ||
@@ -522,6 +523,7 @@ static int cryptd_create_hash(struct crypto_template *tmpl, struct rtattr **tb, | |||
522 | alg = &salg->base; | 523 | alg = &salg->base; |
523 | inst = cryptd_alloc_instance(alg, ahash_instance_headroom(), | 524 | inst = cryptd_alloc_instance(alg, ahash_instance_headroom(), |
524 | sizeof(*ctx)); | 525 | sizeof(*ctx)); |
526 | err = PTR_ERR(inst); | ||
525 | if (IS_ERR(inst)) | 527 | if (IS_ERR(inst)) |
526 | goto out_put_alg; | 528 | goto out_put_alg; |
527 | 529 | ||