lkml.org 
[lkml]   [2010]   [Jun]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] CRYPTO: ablkcipher, avoid NULL dereference
Date
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



\
 
 \ /
  Last update: 2010-06-21 17:03    [W:0.042 / U:0.316 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site