From: Steffen Klassert Date: Wed, 15 Jul 2009 08:51:04 +0000 (+0800) Subject: crypto: cryptd - Fix uninitialized return value X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=05ed8758fa30e088766905d0d600aa393e144353;p=deliverable%2Flinux.git 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 Signed-off-by: Herbert Xu --- 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, 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;