From: Jiri Slaby <jslaby@suse.cz>
To: herbert@gondor.hengli.com.au
Cc: linux-kernel@vger.kernel.org, jirislaby@gmail.com,
"David S. Miller" <davem@davemloft.net>
Subject: [PATCH] CRYPTO: ablkcipher, avoid NULL dereference
Date: Mon, 21 Jun 2010 17:01:23 +0200 [thread overview]
Message-ID: <1277132483-14172-1-git-send-email-jslaby@suse.cz> (raw)
Stanse found a potential NULL dereference in ablkcipher_next_slow.
Even though kmalloc fails, its retval is dereferenced later. Return
from that function properly earlier.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: David S. Miller <davem@davemloft.net>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
---
crypto/ablkcipher.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
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;
--
1.7.1
next reply other threads:[~2010-06-21 15:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-21 15:01 Jiri Slaby [this message]
2010-06-21 20:44 ` David Miller
2010-06-23 10:01 ` 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=1277132483-14172-1-git-send-email-jslaby@suse.cz \
--to=jslaby@suse.cz \
--cc=davem@davemloft.net \
--cc=herbert@gondor.hengli.com.au \
--cc=jirislaby@gmail.com \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®