linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] pcrypt: handle crypto_get_attr_type() errors
@ 2010-03-21  9:28 Dan Carpenter
  2010-03-22 13:23 ` Steffen Klassert
  0 siblings, 1 reply; 8+ messages in thread
From: Dan Carpenter @ 2010-03-21  9:28 UTC (permalink / raw)
  To: Herbert Xu
  Cc: David S. Miller, Steffen Klassert, linux-crypto, linux-kernel,
	kernel-janitors

crypto_get_attr_type() can returns ERR_PTRs if there is a problem. 

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/crypto/pcrypt.c b/crypto/pcrypt.c
index 8020124..41bd80f 100644
--- a/crypto/pcrypt.c
+++ b/crypto/pcrypt.c
@@ -322,6 +322,8 @@ static struct crypto_instance *pcrypt_alloc_aead(struct rtattr **tb)
 	struct crypto_attr_type *algt;
 
 	algt = crypto_get_attr_type(tb);
+	if (IS_ERR(algt))
+		return ERR_CAST(algt);
 
 	alg = crypto_get_attr_alg(tb, algt->type,
 				  (algt->mask & CRYPTO_ALG_TYPE_MASK));

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-03-24 13:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-21  9:28 [patch] pcrypt: handle crypto_get_attr_type() errors Dan Carpenter
2010-03-22 13:23 ` Steffen Klassert
2010-03-22 13:48   ` Dan Carpenter
2010-03-22 13:53   ` [patch v2] " Dan Carpenter
2010-03-22 14:53     ` Steffen Klassert
2010-03-22 15:28       ` [patch v3] " Dan Carpenter
2010-03-23 10:34         ` Steffen Klassert
2010-03-24 13:35           ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).