mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] crypto: Correct kzalloc error test
@ 2008-04-29 13:38 Julia Lawall
  2008-04-29 14:07 ` Herbert Xu
  0 siblings, 1 reply; 4+ messages in thread
From: Julia Lawall @ 2008-04-29 13:38 UTC (permalink / raw)
  To: herbert, davem, linux-crypto, linux-kernel, kernel-janitors

From: Julia Lawall <julia@diku.dk>

Normally, kzalloc returns NULL or a valid pointer value, not a value to be
tested using IS_ERR.

Signed-off-by: Julia Lawall <julia@diku.dk>
---
diff -u -p  a/crypto/cryptd.c b/crypto/cryptd.c
--- a/crypto/cryptd.c	2008-04-16 13:27:56.000000000 +0200
+++ b/crypto/cryptd.c	2008-04-29 15:29:54.000000000 +0200
@@ -190,7 +190,7 @@ static struct crypto_instance *cryptd_al
 	int err;

 	inst = kzalloc(sizeof(*inst) + sizeof(*ctx), GFP_KERNEL);
-	if (IS_ERR(inst))
+	if (!inst)
 		goto out;

 	err = -ENAMETOOLONG;

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

end of thread, other threads:[~2008-04-29 16:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-29 13:38 [PATCH] crypto: Correct kzalloc error test Julia Lawall
2008-04-29 14:07 ` Herbert Xu
2008-04-29 14:18   ` [revised PATCH] " Julia Lawall
2008-04-29 16:27     ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®