netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Akinobu Mita <akinobu.mita@gmail.com>
To: netdev@vger.kernel.org
Cc: David Miller <davem@davemloft.net>,
	Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
Subject: [PATCH] ipcomp: fix crypto_alloc_comp() error check
Date: Mon, 27 Nov 2006 14:07:22 +0900	[thread overview]
Message-ID: <20061127050722.GG1231@APFDCB5C> (raw)

The return value of crypto_alloc_comp() should be checked by
IS_ERR().

Cc: David Miller <davem@davemloft.net>
Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>

---
 net/ipv4/ipcomp.c  |    2 +-
 net/ipv6/ipcomp6.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Index: work-fault-inject/net/ipv6/ipcomp6.c
===================================================================
--- work-fault-inject.orig/net/ipv6/ipcomp6.c
+++ work-fault-inject/net/ipv6/ipcomp6.c
@@ -368,7 +368,7 @@ static struct crypto_comp **ipcomp6_allo
 	for_each_possible_cpu(cpu) {
 		struct crypto_comp *tfm = crypto_alloc_comp(alg_name, 0,
 							    CRYPTO_ALG_ASYNC);
-		if (!tfm)
+		if (IS_ERR(tfm))
 			goto error;
 		*per_cpu_ptr(tfms, cpu) = tfm;
 	}
Index: work-fault-inject/net/ipv4/ipcomp.c
===================================================================
--- work-fault-inject.orig/net/ipv4/ipcomp.c
+++ work-fault-inject/net/ipv4/ipcomp.c
@@ -369,7 +369,7 @@ static struct crypto_comp **ipcomp_alloc
 	for_each_possible_cpu(cpu) {
 		struct crypto_comp *tfm = crypto_alloc_comp(alg_name, 0,
 							    CRYPTO_ALG_ASYNC);
-		if (!tfm)
+		if (IS_ERR(tfm))
 			goto error;
 		*per_cpu_ptr(tfms, cpu) = tfm;
 	}

                 reply	other threads:[~2006-11-27  5:14 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061127050722.GG1231@APFDCB5C \
    --to=akinobu.mita@gmail.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=yoshfuji@linux-ipv6.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).