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 <[email protected]>
Acked-by: David S. Miller <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
This commit is contained in:
Jiri Slaby authored and Herbert Xu committed 2010-06-23 20:01:45 +10:00
1 parent 0f0a8fa735
commit 2716fbf63e
1 file changed
+1 -1
+1 -1
View File
@@ -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;