summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2010-06-23 12:01:45 +0200
committerHerbert Xu <herbert@gondor.apana.org.au>2010-06-23 12:01:45 +0200
commit2716fbf63ee39eadc1aa9b3841b20f75b99a9bc3 (patch)
treef267d6653c2b4d0f11b4b17330bf6a37abdfc42d
parentcrypto: crypto4xx - Fix build breakage (diff)
downloadlinux-2716fbf63ee39eadc1aa9b3841b20f75b99a9bc3.tar.xz
linux-2716fbf63ee39eadc1aa9b3841b20f75b99a9bc3.zip
crypto: skcipher - avoid NULL dereference
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> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r--crypto/ablkcipher.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/ablkcipher.c b/crypto/ablkcipher.c
index 98a66103f4f2..a854df2a5a4b 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;