mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 03:36:19 +00:00
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>
This commit is contained in:
parent
305f9db22d
commit
05ed8758fa
1 changed files with 2 additions and 0 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue