提交 05ed8758 编写于 作者: S Steffen Klassert 提交者: Herbert Xu

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: NSteffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
上级 305f9db2
...@@ -303,6 +303,7 @@ static int cryptd_create_blkcipher(struct crypto_template *tmpl, ...@@ -303,6 +303,7 @@ static int cryptd_create_blkcipher(struct crypto_template *tmpl,
return PTR_ERR(alg); return PTR_ERR(alg);
inst = cryptd_alloc_instance(alg, 0, sizeof(*ctx)); inst = cryptd_alloc_instance(alg, 0, sizeof(*ctx));
err = PTR_ERR(inst);
if (IS_ERR(inst)) if (IS_ERR(inst))
goto out_put_alg; goto out_put_alg;
...@@ -522,6 +523,7 @@ static int cryptd_create_hash(struct crypto_template *tmpl, struct rtattr **tb, ...@@ -522,6 +523,7 @@ static int cryptd_create_hash(struct crypto_template *tmpl, struct rtattr **tb,
alg = &salg->base; alg = &salg->base;
inst = cryptd_alloc_instance(alg, ahash_instance_headroom(), inst = cryptd_alloc_instance(alg, ahash_instance_headroom(),
sizeof(*ctx)); sizeof(*ctx));
err = PTR_ERR(inst);
if (IS_ERR(inst)) if (IS_ERR(inst))
goto out_put_alg; goto out_put_alg;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册