All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "David S. Miller" <davem@davemloft.net>,
	Richard Hartmann <richih.mailinglist@gmail.com>,
	linux-crypto@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch] crypto/ablkcipher: missing return statement
Date: Thu, 15 Jul 2010 07:57:36 +0000	[thread overview]
Message-ID: <20100715075736.GC5164@bicker> (raw)

The intent was to return here.  In the original an allocation failure
would lead to a NULL dereference.

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

diff --git a/crypto/ablkcipher.c b/crypto/ablkcipher.c
index 98a6610..a854df2 100644
--- a/crypto/ablkcipher.c
+++ b/crypto/ablkcipher.c
@@ -165,7 +165,7 @@ static inline int ablkcipher_next_slow(struct ablkcipher_request *req,
 
 	p = kmalloc(n, GFP_ATOMIC);
 	if (!p)
-		ablkcipher_walk_done(req, walk, -ENOMEM);
+		return ablkcipher_walk_done(req, walk, -ENOMEM);
 
 	base = p + 1;
 

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <error27@gmail.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "David S. Miller" <davem@davemloft.net>,
	Richard Hartmann <richih.mailinglist@gmail.com>,
	linux-crypto@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch] crypto/ablkcipher: missing return statement
Date: Thu, 15 Jul 2010 09:57:36 +0200	[thread overview]
Message-ID: <20100715075736.GC5164@bicker> (raw)

The intent was to return here.  In the original an allocation failure
would lead to a NULL dereference.

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

diff --git a/crypto/ablkcipher.c b/crypto/ablkcipher.c
index 98a6610..a854df2 100644
--- a/crypto/ablkcipher.c
+++ b/crypto/ablkcipher.c
@@ -165,7 +165,7 @@ static inline int ablkcipher_next_slow(struct ablkcipher_request *req,
 
 	p = kmalloc(n, GFP_ATOMIC);
 	if (!p)
-		ablkcipher_walk_done(req, walk, -ENOMEM);
+		return ablkcipher_walk_done(req, walk, -ENOMEM);
 
 	base = p + 1;
 

             reply	other threads:[~2010-07-15  7:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-15  7:57 Dan Carpenter [this message]
2010-07-15  7:57 ` [patch] crypto/ablkcipher: missing return statement Dan Carpenter
2010-07-16  2:21 ` David Miller
2010-07-16  2:21   ` David Miller
2010-07-16  2:23   ` Herbert Xu
2010-07-16  2:23     ` Herbert Xu
2010-07-16  2:27     ` Herbert Xu
2010-07-16  2:27       ` Herbert Xu

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=20100715075736.GC5164@bicker \
    --to=error27@gmail.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=richih.mailinglist@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.